To actually flash an LED until a button is pressed, if that's ALL you want to do, doesn't take much code. Just flash the LED until an interrupt fires. Then turn off the LED and loop forever in the interrupt service routine.
// untested code
// hook the button up between the ground and pin 2, and we'll use INT0 with the internal pull-up
const int LEDPin = 13;
digitalWrite(2, HIGH); // Enable internal pull-up
attachInterrupt(0, interruptServiceRoutine, LOW);
delay(1000); // or whatever
while(1); // Loop forever
Interrupts remain disabled so the LED should stay off.