This is not a mIRC bug.

mIRC is limited in the length it will store in a variable.

As such, mIRC will fill it up, and as such, it wraps at the point where you claim the bug is produced.

It is up to the script (you) to deal with search, replace, dis/asembly of the incoming text.