On *:OPEN:?:*:set $+(%,openquery.,$nick)
On *:ACTIVE:?:{
unset $+(%,openquery.,$active)
}
this way when you click on a window query you unset the variable and you know you've seen it. Then you can add a timer to remind you all the unseen pm. Hope this can help you