Yeah, you could use something along the lines of
on 1:OPEN:?:*:{
if ($comchan($nick,0) > 0) { echo -a (Incoming Message) $nick is on a common channel. }
else { echo -a (Incoming Message) You do not share a common channel with $nick $+ .) }
}
You can edit the message to say whatever you'd like.