Your if comparison is ambiguous. you put If ($nick isop #) and then if ($nick !isop #)...do you want the op kicked or saved? Additionally, the isvo is an obsolete operator. You should use isvoice instead.
''/msg @ops in case if this was an error. | halt" <- I'm not sure why you place that phrase in the first place. It's not needed.
Your script will be a lot easier with regular expressions:
on @*:TEXT:*:#: {
var %x = /(http:\/\/\w+|www\.\w+)/i, %y = /\.(\w+){2,3}$/i
if ($nick !isop #) && ($nick isvoice #) && ($regex($1-,%x)) || ($regex($1-,%y)) {
ban -k # $nick 2 Spam detected!
}
}
This code I show you will cover everything and kick ONLY the voiced users, excluding the oppers.