For 1 thing, your menu is bad. The line that looks like this:
..Remove mute $1 $+
if ($1 == %Mute.Nick) {
... is missing the :{ at the end of that 1st line. If that's not the cause of your problem, please clarify whether the script fails because %Mute.Nick does not match the user being muted. From your description, it look like you're saying that the -b shows as part of the banmask in the "channel central" you see by double-clicking in the channel.
Also an observation that this script as written only works for 1 nick at a time. If you mute someone while someone else is already muted, all the variables change to nick#2 and it doesn't work against nick#1 anymore.
While you can create global variables, that would require using compound syntax, which can be hard for you to do correctly. It's probably easier to do it from a hashtable. Assuming your table is named "mute", you could create the compound itemname without using $eval or square braces. To keep it simple, you can create an alias that creates a string like network.channel.nick from the $nick input:
alias netchannick { return $+($network,.,$chan,.,$1) }
And then you can create the hashtable variable like:
hadd -m mute $netchannick($1) $1
and then test for the value like:
if ($hget(mute,$netchannick($1)) == $1)
You'd also want to create your timers with a unique name per nick, and delete the hashtable item like:
timer5 $+ $netchannick($1) 1 $calc(%Mute.Time * 60) hdel -s mute $netchannick($1)
Some of your global variables can work just fine as local variables, which don't need to be unset. I find %mute.channel created twice but never used.
I find %MUTEMSG used only within the same instance where it was set, so you can create it using /var instead of /set and it should work the same.
You can get additional info on commands and identifiers at
https://en.wikichip.org/wiki/mirc/commands