No need for all the text events, you can only have one input per script as far as i know.
This is missing alot of brackets. For your dialog part you have alot of on dialogs you can shorten it lot with:
on *:DIALOG:operator:sclick:*:{
if ($did == 11) && ($me isop $active) { mode $active +o $$?="Give op to who?" }
if ($did == 13) && ($me isop $active) { mode $active -o $$?="DeOp Who?" }
}
As for the whole thing itself it does not work.