There are 2 ways I can think of which a script could be causing this, both of which would be easy to check for.

1. This command enables mirc being ontop: /showmirc -o
2. If you have something that's using the well known /sendkeys alias to do things which can't be done by normal commands or identifiers, if the script isn't written well, there can be sometimes when the keys are entering a menu the wrong way and executing the ontop setting.

But the most likely ways are the 3 ways Khaled mentioned