The way that it's written, it really should sleep for 20 seconds there. It does in my test environment. I have to make a couple of alterations for it to run in my shell though. Newer versions of bash don't like the double equal "==". I also removed the "$" from the echo lines, though I don't think that's affecting how your script runs:
status=$(curl -s -k https://somesite.com/heartbeat)
if [ "$status" = "alive" ]; then
echo 'We may have a problem, let me check again in 20 secs before freaking out.'
status2=$(curl -s -k https://somesite.com/heartbeat)
if [ "$status2" = "alive" ]; then
echo 'Nah, we cool. Alive!'
echo 'No, this is for reals! Evasive maneuvers!'
echo '<do stuff here>'
You don't get any errors or anything, it just skips to the next 'if'?