I'd consider using a goto for this.

Code:
{
elseif ($1 == +h) && ( $nick isop $chan ) && ($2 ison $chan) { /set %com +h $2 | /set %mes $2 should now have halfop status. | goto end }

:end { mode $chan %com | msg $chan %mes }

}


Also, every line of this script checks if $nick isop $chan. What you should do is only check this once at the beginning. Or use $istok to consolidate the desired modes into one comparison, then halt if $nick !isop $chan. Also, if ($1 == +h), then you can /set %com $1.

This logic allows you to write one line to handle most events.

if ($istok($1,+q.-q.+o.-o.+h.-h,46)) { mode $chan $1 $nick }

This is just an example of what I'm talking about.

Good luck!