Your example sentence establishes less of a time frame than a cause and effect relationship between the addressee's cooking dinner and your 3-hour wait, thus no reason to use the past progressive. The for in front of three hours signals nothing and can be omitted:
Last time you cooked, I waited /had to wait three hours for dinner.
The past or past perfect progressive uses a continuous action to establish a time frame for another action:
I had already been waiting three hours for dinner when I remembered the candy bar in my coat pocket.
While I was waiting for dinner, I remembered the candy bar.
Note how the three hours sets a limit on the wait before the fortuitous discovery of the candy bar, that is, it was a continuous action for three hours but no longer, forcing the wait into the past perfect progressive rather than the past progressive.
When can a signal word for past or past perfect progressive because it introduces the framed event; while because it introduces the frame.