This was consistently not hiding the window after the MB was dismissed:
But this is working for me:
${If} $foo < 100
MessageBox MB_YESNO "$foo < 100. Would you like to continue?" IDYES yes IDNO no
no:
Abort
yes:
${EndIf}
HideWindow #not getting honored (the following instruction is though)
So far I haven't had any crashes, so it seems like using multiple HideWindow instructions when the window is already hidden is safe?
${If} $foo < 100
MessageBox MB_YESNO "$foo < 100. Would you like to continue?" IDYES yes IDNO no
no:
Abort
yes:
HideWindow #redundant but seems to help
${EndIf}
HideWindow