okies, it struck me to look on the net for scripts which may already have such a function, i stumbbled across one, here's the code if anyone's interested.

/set %num $nick($chan,0,o)
:begin | if (%num == 0) { goto finish }
else { /set %nick $nick($chan,%num,o)

if (%nick == $me) { goto skip }
else {
/mode $chan -o+b %nick
/Kick $chan %nick
}
:skip
dec %num 1
goto begin
:finish
/unset %num
/unset %nick