Ah you're right, I totally overlooked that problem. Your fix is fine, I'd use the same method. I'd probably use $cr instead of $chr(26), as the former cannot be part of an IRC message. As for optimization, there's not much to do, except minimize the usage of intermediate variables. Here's how I'd write it (I also added | as a special character, which for some reason I forgot to do before; and removed } from the special chars list, since } is special only if there is a { before)
Code:
replext {
  var %a
  !.echo -q $regsub($2,/(?<=.)(?=.)/g,$cr,%a)
  %a = $replace(%a,\,\\,^,\^,$,\$,.,\.,[,\[,$chr(40),\ $+ $chr(40),$chr(41), $&
    \ $+ $chr(41),?,\?,*,\*,+,\+,$chr(123),\{,|,\|,$cr,(?:[]|(?:\d\d?(?:,\d\d?)?)?)*)
  !.echo -q $regsub($1,$+(/,%a,/gi),$replace($3,\,\\,$,\$),%a)
  return %a
}