Using $chan isin %var is dangerous if you are in two channels that are similar, e.g. #trivia and #trivia-help

If #trivia-help is in the %var then (#trivia isin %var) will also be true. Granted, it's not very likely, but a real possibility still.

You're better off using the $istok identifier. For instance $istok(%var,$chan,44) if your channels are separated by token 44 (commas).