for my server it is rawmode, but I will trust you using your mode event.
on *:mode:#:{
if ($1 == -i) mode $chan +i
elseif ($1 == +i) mode $chan -i
}
This is pretty basic stuff, you can get pretty fancy pretty quickly if you want.
oh sorry, read your post again.
on *:mode:#:{
if ($1 == +i) mode $chan -i
}