As drum stated, you need to escape any identifiers when passing to mIRC via script.

$!chr(35)