Perhaps with a bit of modification this will do for you?
viewtopic.php?t=1254&highlight=countdown
or you could try the attached .imp. What you would do is set a variable, in this case, <bra> to the number of seconds you wish your timer to work (in your case 5minutesX60seconds=300). Set the page where your timer is to the number of minutes/seconds you wish and then have it go to whereever you want pagewise.On the timer page, you have two onShow actions. The first one resets <bra> to its specified number. The second action loops until the page changes and runs a script.
It should be pretty straight forward to follow.
I think this will do what you want. It's probably not as elegant as someone else could do, but it seems to work.