$comchan(nick,0) returns the total number of common channels
$comchan(nick,1) returns the first common channel name
so perhaps if you need the name you could use %x and a while loop
set %x $comchan(nickname,0)
while %x > 0
something of the sort
hope that helps