I know you've gotten a lot of replies and options to try for your request, but I thought I'd give you what I came up with for you to take into consideration.
Code:
 on *:open:?:*:{
  comchan $nick
}
alias common {
  var %a = 1, %b = $comchan($1,0)
  while %a <= %b {
    var %chan = $addtok(%chan,$comchan($1,%a),32)
    inc %a
  }
  $iif(!$isid,echo -a,return) $nick has the following channels common with you: $replace(%chan,$chr(32),$+($chr(44),$chr(32)))
}
raw *:*:{
  if $istok(301 310 311 312 313 317 319,$numeric,32) {
    var %nick = $2
  }
}
raw 318:*:{
  comchan %nick
}