Code:
on *:RAWMODE:#: { 
 ;$1 == the one who sets it, $3 == modes set, $4- == nick(s) affected
 if (-* iswm $3) && (a isin $3) { ;on Deprotect event }
 if (+* iswm $3) && (a isin $3) { ;on protect event }
}