It would be beneficial to pay some attention to the blink without delay example, and learn to NOT use delay(). If you get rid of the delay()s, then what you want to accomplish is trivial. Resetting the start time effectively changes the end time, making stopping at the right time a no-brainer.