I always do timers like this:
` Make text overwrite the black background
set text opaque
` Set the timer
tim=timer()
` Set the delay
Delay=100
do
` Show the variables and timer()
text 0,0," var = "+str$(var)+" "
text 0,20,"timer() = "+str$(timer())
text 0,40," tim = "+str$(tim)
text 0,60," Delay = "+str$(Delay)+" "
` Check if it's time to allow key presses
if timer()>tim+Delay
` Check for arrow keys
if keystate(200) then inc var
if keystate(208) then dec var
` Check for + on number keypad
if keystate(78)
` Increase Delay by 50
inc Delay,50
endif
` Check for - on number keypad
if keystate(74)
` Decrease Delay by 50
dec Delay,50
if Delay<0 then Delay=0
endif
` Reset timer
tim=timer()
endif
loop
Use the up and down arrow keys to increase/decrease var and use the + and - signs on the number keypad to increase/decrease the delay. The delay is the milliseconds to wait before allowing a keypress. 1000 milliseconds = 1 second.