As there is no loop function running continuously, do not use an endon(). This will add to the max number of script variables allowed, and is completely unnecessary unless you have a loop function which does more than count (as in the current method). Endon() is designed to kill continuous loops only. It will not end any other function such as a count.
Max script variables will crash a server, and is reached when the game counts ever single instance of endon(), waittill(), or wait(). Conserve your script variables at all costs. It is very easy to reach the ceiling with them.