You can set the exit value to a non-zero value and then loop until the command returns with a exit 0 (success). Here is a script I have that does that:
while [ $? != 0 ]; do rsync -avlH --delete --exclude=6.1/archive --exclude=6.1/i386/archive --exclude=6.1/x86_64/archive --exclude=6.1/i386/iso --exclude=
6.1/x86_64/iso rsync://rsync.gtlib.gatech.edu/scientific/6.1 6.1/; done
Not the best of scripts - it was more of a thought experiment of ensuring that the rsync will restart when it fails until it has finished successfully.
Edit: In your case, you probably want something like:
$(exit 1) ; while [ $? != 0 ]; do sleep 1 ; nc -vvv -z 192.168.15.37 22 && ssh 192.168.15.37 ; done
You can add error conditions here and there, but the important thing is to immediately connect once you verify the port is open, which is what the && operation is for - it will execute the next command if the previous command was successful. (Until then, a failed connection will return a non-zero exit code, which will cause the loop to continue). Once you login successfully and then log out, the exit code that is returned from that successful login session will terminate the loop.
(the sleep command is optional, but note that in some cases, without a sleep loop, your display may slow down until you either minimize it or switch to the next window, which could be a problem if your display is a remote desktop)