Make a global variable named timer
Make a global variable Time Bonus and set it to the amount of seconds the level should take.
system every 1 second add one to timer
set text - "Time: "&Floor(Timer/60) & ":" & right("00"&Floor(Timer%60),2)
at the end of the level:
system comape two values : time bonus-timer > 0 - add something to score.