So, would this be correct, then?

on *:MODE:#: {
if (mode $chan +i) {
mode $chan -i }
}