Johnny when you said that the timer function doesn't loop at the moment you mean you never added a loop for it to go back to the beginning right? Can't you just do..

Idk the syntax for the psp buttons and crap but..

If time == 4 {
turn code off
turn code on
reset time