SSH_Exec command options

I suppose you can wrap the ssh-exec in do/on-error block, that cover a network failure/timeout (although not 100% it will catch that since didn’t test, but should)

:do {
  /system ssh-exec address=192.168.88.10 user=root command="shutdown now"
} on-error={
  /system reboot
}

You can use also tool netwatch, which handles the ping, etc., see http://forum.mikrotik.com/t/need-help-completing-a-script/171018/1