That on rawmode is not a suitable replacement at all.
What if I set +oo, since you only test if $1 == +o, it fails. What if I set +lo, again it fails, same for any other combination of modes. It's a lot more complex than that.
Edit:
ON *:RAWMODE:#:{
var %takepara = $remove($gettok($chanmodes,1-3,44),$chr(44))
var %i = 1, %j = 2, %set = $true
while ($mid($1,%i,1)) {
var %t = $ifmatch
if (%t == +) %set = $true
else if (%t == -) %set = $false
else if (%t isin $nickmode) {
var %nick = $eval($chr(36) $+ %j,2)
if (%set && (%t == o || %t == a)) {
.echo -a this is like ON OP, except it also works with +a! %nick is the person who was +o/+a'ed
}
inc %j
}
else if (%t isin %takepara) inc %j
inc %i
}
}
That should correctly handle +o and +a in all situations. Replace the .echo -a with the commands you want to execute. %nick contains the nickname that was just set +o or +a, %t contains the mode letter (either o or a) and %set = $true if it is +o/+a, and %set = $false if it is -o/-a.