Right, but the problem is the trigger.
At the time of this writing, the only code that could run locally was the official smart lighting feature and some parts of a smart home monitor. But none of those have an “Internet is not available” trigger.
That said, this is a common use case, and if you take smartthings out of the equation it’s easy enough to do.
There are devices sold which are smart Wi-Fi pocket sockets That regularly ping a site on the Internet and if they can’t reach it they reboot themselves.
Outside of the smart things world, these are used to restart modems.
Anyway, you can find discussion in the following thread.