Well you other choices for this too...
1. use "check gateway" on the LINK route – now, this will just ping the "nexthop" (e.g. 10.51.11.253, not 8.8.8.8/"internet) and disable the route if the gateway is not pingable. This is dirt simple since you check need check the box for "check gateway" in IP>Routes for your 0.0.0.0 route:
Periodically (every 10 seconds) check gateway by sending either ICMP echo request (ping) or ARP request (arp). If no response from gateway is received for 10 seconds, request times out. After two timeouts gateway is considered unreachable. After receiving reply from gateway it is considered reachable and timeout counter is reset.
2. more complex, especially with multiple WANs, but "recursive routing", see
https://help.mikrotik.com/docs/pages/vi ... d=26476608
3. while posting starts with: how to use script to failover – & possible and people do it – but IMO 1 or 2 are better choices unless you're already familar with RouterOS scripting.
One note. You have internet detect enabled. This generally less useful than it appears. It may work for you, but I found the "side effect" can break things (e.g. it will add a DHCP client to any monitored interface if nothing has internet).