for the certain server thats a easy if statement Id use network tho personally but
if ($server == blah.mirc.com) { do stuff }
Id use network
if ($network == mirc.com) { do stuff }
and for the all channels thing youd want to use $comchan
From help
$comchan(nick,N)
Returns the names of channels which both you and nick are on.
Properties: op, help, voice,
$comchan(nick,0) returns the total number of common channels
$comchan(nick,1) returns the first common channel name
$comchan(nick,1).op returns $true if you're an op on the channel