The JSONTomIRC.mrc script contains the ON EXIT event.
I tested several scripts, including JSONTomIRC.mrc, added several on EXIT events, and have not been able to reproduce any issues so far. We need to be able to reproduce your issue in order to determine what is causing it.
My guess is that the issue is not related to JSONTomIRC.mrc or to the on EXIT event but is due to one of your other scripts which is corrupting memory in some way. This then goes on to affect other features.
I notice that in previous posts, you have had issues with vars.ini, as well as memory issues with /sockread. Since we are seeing a "Content-Type: text/html; charset=", is it possible that one of your network-related scripts is causing the issue?
You would need to install a clean copy of mIRC in an empty folder, with no scripts or addons and then add scripts one at a time, run mIRC, run one script, use /saveini, and check the vars.ini file. One of your scripts, when it is run, is causing the issue.
Once you have narrowed down which script is causing the issue, you can then add debugging to the script, eg. make it stop at different points, use /saveini, and check vars.ini again. This should gradually enable you to narrow it down to a specific line/alias/identifier.