A few things/questions/suggestions...
"if ($nick == $me) { halt }" is useless, because the bot wouldn't be able to activate the event itself anyways.
You can just set %lol as a local variable, so that you don't have to unset it every time the script is run.*
Why go through the trouble of adding a comma between the channels (without spaces between the channels and the commas), only to replace the comma with a space immediately after? var %lol = %lol $comchan($nick,%x) seems much easier.*
*These are unless you're actually using the variable %lol in that format for some other event.
For fun, $regsubex method:
on *:TEXT:!chanlist:#: msg # Im in: $regsubex($str(.,$comchan($nick,0)),/./g,$comchan($nick,\n) $chr(32))
( five edits later... o_o )