Keep in mind that $chr(2) and $chr(3) are non-printable characters. It's unreasonable to expect non-printable characters to behave correctly in a file format that is designed to be modified with a standard text editor -- even if you can get away with using them in mIRC.
It would be preferable to replace any non-printable characters with an escape sequence instead, or use a more appropriate file structure.