```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++) {
    const char = input[i];

    if (char === ';') {
      if (!inQuotes) {
        if (currentSegment.trim() !== '') {
          pairs.push(parseOption(currentSegment));
          currentSegment = '';
        }
      } else {
        currentSegment += char;
      }
    } else if (char === '"') {
      inQuotes = !inQuotes;
      currentSegment += char;
    } else {
      currentSegment += char;
    }

    if (i === input.length && currentSegment.trim() !== '') {
      pairs.push(parseOption(currentSegment));
    }
  }

  const keys = new Set<string>();
  for (const pair of pairs) {
    const [key] = pair;
    if (keys.has(key)) {
      throw new Error('Repeated key');
    }
    keys.add(key);
  }

  return pairs;
}

export function parseOption(segment: string): string[] {
  const idx = segment.indexOf('=');
  if (idx === -1) {
    throw new Error('Invalid segment');
  }

  let key = segment.substring(0, idx).trim();
  if (!/^[a-zA-Z][a-zA-Z\d_]*$/.test(key)) {
    throw new Error('Invalid segment');
  }

  let value = segment.substring(idx + 1).trim();
  if (value.startsWith('"') && value.endsWith('"')) {
    value = value.slice(1, -1);
  } else if (value.startsWith('"')) {
    throw new Error('Unterminated quote');
  }

  return [key, value];
}
```