Do you want it to stop and then resume your delay or hold and then continue with your delay when you release.
Either way you have to replace every instance of delay(500) with some code. Now is a good time to learn about functions.
OK so now you have code like a long string of sausages. Now for your next level of learning. Remember this mantra:-
When you find your self writing code that keeps repeating the same or very similar lines, there is a better way of doing it.
Look at holding the data for the on and off states in an array, look at functions and look at the millis() function to replace your delay() calls. That last one will enable you to do things during a delay.