Project 8 Hour glass - How to make the LEDs blink once all the LEDs have lit up

Hi all! I am still rather new to programming!

I have managed to program the hourglass as per the example given in the book. However, I am having some trouble trying to make the LEDs blink a set amount of times once all the LEDs have lit up.

Currently, I can achieve this using the delay function. However, this is not ideal for me as I would want the hourglass to be able to reset when i invert it even when the LEDs have entered the "blinking" stage.

I have exhausted all my knowledge and use various "if", "while" and even "switch" functions to try and get the LEDs to blink but to no avail.

Could anyone guide me as to how I can make the LEDs blink at the end without using the delay function? Thanks in advance!