OP's example use case in the post was with the internet still being up. Building off of that yes, I'd log into the power switch remotely via the internet where I can then power cycle anything plugged into it - for me it was just to restart unresponsive desktops or whatever was plugged into it.
But you wouldn't need internet to power cycle the internet router itself by using scheduled tasks. e.g. the power switch can check that the internet router is responding to pings every x seconds/minutes and power cycle it if stops responding. (it has other checks/conditions it can use besides simple pings)
That said my own equipment rarely/never needs a reboot so in the case my network loses internet access it usually means the internet is actually down, nothing I can do about that aside from maintaining backup internet if I needed.
Thanks for the share! It's not something I'd need to use but I'm all for people sharing their scripts with the community for this stuff :)
One suggestion, you may want to look at re-writing your script to move away from the VBScript (.vbs) dependency since Microsoft is moving towards disabling and eventually removing it from Windows 11 and onward. It'll likely be disabled by default in 2027 so you have plenty of time.
https://techcommunity.microsoft.com/blog/windows-itpro-blog/vbscript-deprecation-timelines-and-next-steps/4148301