I've been fighting a few popups with a timer that is executed every second for years. If it doesn't work right away, you'd just have to change the IfWinExist to match your window.
SetTimer, CheckWin, 1000
return
CheckWin:
SetTitleMatchMode, 2
IfWinExist, ahk_class TMessForm, Number of Kits
{
WinClose
; alternatively, write code to activate window
; then send Enter as in your example
TrayTip, Popup-Killer,Window killed,3, 17
return
}
return
BTW, I really like MCL's Shell Hook idea from the comments...