```ts
export function scanPairs(input: string): string[][] {
    if (typeof input !== 'string' || input === '') {
        throw new Error('Invalid input');
    }

    const pairs: string[][] = [];
    let currentSegment = '';
    let inQuotes = false;

    for (let i = 0; i < input.length; i++) {
        if (input[i] === '"') {
            inQuotes = !inQuotes;
        } else if (input[i] === ';' && !inQuotes) {
            const parsedOption = parseOption(currentSegment);
            pairs.push(parsedOption);
            currentSegment = '';
        } else {
            currentSegment += input[i];
        }
    }

    if (currentSegment !== '') {
        const parsedOption = parseOption(currentSegment);
        pairs.push(parsedOption);
    }

    return pairs;
}

export function parseOption(segment: string): string[] {
    const parts = segment.split('=');
    if (parts.length !== 2) {
        throw new Error('Invalid option format');
    }

    const key = parts[0];
    const value = parts[1];

    if (!/^[a-zA-Z_][a-zA-Z_0-9]*$/.test(key)) {
        throw new Error('Invalid key');
    }

    return [key, value.startsWith('"') ? value.slice(1, -1) : value];
}
```