There is an -e switch you can use for a variable. It means to unset it when mIRC exists:
inc -e %ts_current
For the exit event, you can just use it for the #syncl disable. You can also use
$color($event)