If anyone can/wants to answer, they will; no need for nudging posts.

Regarding your last question, I can't know why it doesn't update when mirc isn't active, but $active is not the problem, it works even if mirc isn't the active app.