Need some logic/syntax help!

the program jumps straight into gapTimer() and not switchTrack().

How have you determined this? It looks like the only path into gapTimer() is through switchTrack().