Solved by going back to the help files yet again and modifying one of the example scripts (instead of using a while loop that I couldn't make work)
alias AOP_remove_channel {
set %ra 1
:next
set %nick $nick(#,%ra)
if %nick == $null goto done
if %nick isop # .aop -r %nick # 7
inc %ra
goto next
:done
}
Thanks again everyone (I'll get this yet
)