If you're going to use a while loop for listing all the channels horizontally, you might as well do this:
on *:TEXT:!chanlist:#:while ($chan($0)) tokenize 32 $1- $v1 | .msg # I'm in: $2-
And for $comchan:
on *:TEXT:!chanlist:#:while ($comchan($nick,$0)) tokenize 32 $1- $v1 | .msg # $me and $nick are in: $2-