I don't know what event(s) you're referring to, but the general frame is:
on *:event-name:{
if ($network == NetworkName) {
continue to do this stuff
}
}
e.g.
on *:connect:{
if ($network == DALnet) {
msg nickserv identify password
}
}
So this on connect event would work if you connect to DALnet, but not to another network.
Also see /help if then else.
Regards,