Instead of the timer, just use

./close -m $nick

the window will close fast enough you won't be bothered with it