Your script only checks for ctcp events.

If the nick on the timer does not send a ctcp command to the channel you code will devoice the user.