Contributing again;
You can group if events to make the code cleaner. For example:
if ($isowner($chan,$nick) == $false) {
if ($isadmin($chan,$nick) == $true) { etc }
if ($nick isop $chan && $isadmin($nick,$chan) == $false) { etc }
}
You could also just use one haltdef at the end. And why do you include echo -m $nick in your channel text event?