Only a few miles....only a few feet... etc are not durational measurements but "completional" (maybe that word doesn't exist) and as such are incompatible with the progressive/continuous. They're compatible with the perfect.
not OK The new skyscraper had been rising for only ten storeys when the steelworkers went on strike.
not OK I had been eating only three bites when I chipped a tooth.
not OK I had been taking only three sips when a fly landed in my glass.
not OK I had been climbing only three rungs when the ladder gave out.
OK I had been watching the show only three minutes when the TV went dark.
OK I had been taking that detour for only three weeks when the bridge was re-opened.
OK I had been snoozing in the back of the lecture hall for only three lectures when the news came that the professor had quit teaching to become a race-car driver.