Have I placed the LOW and HIGH digitalWrite in the wrong loops etc?
Well you don’t seem to understand loops. The loop function will run repeatedly, and many hundreds of times per second, so at the first thing your function does is to set pin 7 high every time, irrespective of what has happened before. You only want to set this high if the timer for it being low has expired.