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.

<sup>not OK</sup> The new skyscraper had been rising for only ten storeys when the steelworkers went on strike.

<sup>not OK</sup> I had been eating only three bites when I chipped a tooth.

<sup>not OK</sup> I had been taking only three sips when a fly landed in my glass.

<sup>not OK</sup> I had been climbing only three rungs when the ladder gave out.

<sup>OK</sup> I had been watching the show only three minutes when the TV went dark.

<sup>OK</sup> I had been taking that detour for only three weeks when the bridge was re-opened.

<sup>OK</sup> 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.