As far as I know, md5-hashes are made of letters and digits only (like the $md5(bonkers) in your example), they do not contain chars like "$" "+" or "=".
I suppose the IRCD is creating a pass using md5 in some way, but this pass is not the "md5 hash" of the password sent....
If you really need to store that pass (storing an opper pass inside a script is no good idea imho), you need to parse the server reply. If you don't need to store it, just use something like:
alias makepass {
noop $input(Please enter password to make,eog,Make Password)
$iif(($!),mkpasswd md5 $v1,echo -a please retry)
}