単にこういうことじゃないの?
v2 だと try catch で WinGetTitle のエラーハンドリングはできるけど。

WinGetTitle - Syntax & Usage | AutoHotkey v1
https://www.autohotkey.com/docs/v1/lib/WinGetTitle.htm
> Remarks
> If there is no matching window, OutputVar is made blank.