How about this:
_main PROC
loop00:
INVOKE IsOnline,offset szURL
or eax,eax
jnz done
push 0
push offset MyTitle
push offset MyText
push 0
call MessageBoxA
Invoke Sleep,5000 ;Sleep so it doesn't use 99% CPU
jmp loop00
done:
INVOKE Beep,750,1000
exit
_main ENDP
.data
MyTitle db "No internet",0
MyText db "No active internet connection found, retrying in 5 seconds.",0
That will first wait test for IsOnline, and if it fails, will wait 5 seconds and try again. Otherwise it goes to the beep before exiting.