Well, you pretty much described how to do it by yourself laugh...

Make an alias consisting of an IF statement that checks the API if the stream is online. There are probably multiple things in it that will indicate it's offline. If it is offline, then msg # /dehost stream_name (or whatever the command is)

Then just put that alias on a timer