(3) Option 3 is the correctreplacement as the principal clauseis in simple past, whereas thesubordinate clause expresses thatsomething started and continueduntil another thing in the past. Sothe past perfect continuous tense‘had been working’ should be used.