from the fact you're doing the timeout by doing a /msg $chan, I'm guessing this is a twitch server, which I'm not familiar with.

However your issue doesn't seem to be twitch related.

1. For the ON TEXT line, :#: is sufficient to enable this event for all channels.
2. Are you sure it does timeout for *ALL* users? Or just the ones whose nick begins with a letter from M-Z? If you really want to do this just for nicks beginning with 'mark', you should instead use:

if (mark* iswm $nick) {
stuff goes here
}

ISWM has it match the wildcard, while ">=" is checking to see if their nick would follow 'mark' in the dictionary.