The control codes used for color, bold, italics, etc. are non-printable characters. This means that they may be visible as boxes, or other character shapes, or they may be non-visible depending on the type of font that you are using. There is a discussion
here about this.
That said, the boxes in your examples should not be visible in status/channel/query windows if they are valid control codes that mIRC supports. As they are visible, this seems to indicate that the original control codes were modified in some way and are no longer valid.
The only way to track down the cause of this is to test this using a clean copy of mIRC, with no scripts installed, to see if you can reproduce the issue.