The best way would be to make a script that works with $appactive and /showmirc, so whenever $appactive returns $true, you just /showmirc -t.
So basically...
On 1:START:{ .timertray 0 1 checkstate }
alias checkstate {
if ($appactive) { .showmirc -t }
}