Forget sleep(x); its old syntax, use wait(-x); instead.

Easy minute timer using wait(-x):
Code:

var minutes = 0;
var status_timer = 0;

function set_timer(_mode)
{
minutes = 0;
status_timer = _mode;
while(status_timer)
{
minutes += 1;
wait(-60); //waits 60 seconds
}
}

//call the function the following ways:
//start the timer: set_timer(1);
//stop the timer: set_timer(0);