Few minor things.

1. Change

from
on 1:MODE...
to
on *:MODE...

As you saw how I changed your 1:TEXT to *:TEXT, this avoids rare cases where someone can be put into a 'level' that matches * but doesn't match '1'

2. Instead of having a compound if() to check both items, you can use $nick(channel,$nick,included,[excluded]) to check both things.

From
if $nick ison #mychan && $nick !isvoice #mychan
To
if ($nick(#mychan,$nick,a,v))

The 'a' means 'all', so this finds them in a version of the nicklist where anyone having voice isn't present, returns 0 if they're not on that altered list, or returns N if they're the Nth on that list.

3. Likewise,

From
elseif $nick ison #mychan && $nick isvoice #mychan
To
elseif ($nick(#mychan,$nick))

... matches anyone who is on the list. For this case you don't need the 'isvoice' because this is an elseif condition, and the only time this is reached is when someone having voice in the channel does this.

4. If the #2 setting needed to see only the people who were not voice-and-above, you can use 'r' to see only those without any status, $nick(#mychan,$nick,r). But I didnt do that, because you don't want to ignore an @op in the elseif condition because they did a !voiceme.

In fact, you may want to have the script just ignore the 'voiceme' from anyone who's already got a better status by putting at the top:

if ($nick(#mychan,$nick,a,rv)) return

Note this isn't the same as $nick(#mychan,$nick,o) since it's possible in some networks for someone to have & or ~ status without also having @

5. If you don't want the /enable or /disable commands to generate a message in the status window, you can use the silencing dot, like use used for .privmsg

.enable #autovoice
.disable #autovoice

6. There are alternatives to using /enable and /disable, depending on how you use them. Each time you open the scripts editor, any global %variable that's been created gets written to vars.ini, which is fine. However it also triggers a diskwrite of the script file if a line has been changed by the /enable or /disable command, which can sometimes be confusing "why is my scriptfile changing if I didn't touch it..."

A cheater way to create a setting is to use /ialmark to create an ialmark against your own nick or anyone else's nick. It travels to the new nick when it changes nick, and only goes away when you no longer share any channels with that nick. Which includes going away when you leave your last channel, or you disconnect, or you /ialclear

Think of /ialmark as a hashtable attached to each nick in the $ial(), which is a separate list for each network.

//echo -a result: $ialmark($me,autovoice).mark | ialmark -n $me autovoice on | echo -a result: $ialmark($me,autovoice).mark | ialmark -n $me autovoice off | echo -a result: $ialmark($me,autovoice).mark | ialmark -rn $me autovoice | echo -a result: $ialmark($me,autovoice).mark

Instead of enabling in a way that changes the scriptfile with
/enable #autovoice
you can just set an ialmark against your own nick:
//ialmark -n $me autovoice on
(can use the silencing dot too)
You'd then disable, instead of
/disable #autovoice
you would either remove the ialmark
//ialmark -rn $me autovoice
or
//ialmark -n $me autovoice off

Then, since the #group is not there to hide the code when it's disabled, you could have as the 1st line of each of your ON TEXT events:

if ($ialmark($me,autovoice).mark != ON) return

Note that my example assumes just 1 channel is being autovoiced, as otherwise you'd probably want an ialmark-name of something like $+($network,$chan)

7. The slashes in /command or //command are needed in the editbox but are ignored in scripts, though I sometimes leave them there to make it easier to copypaste them to the editbox.