As other posters say, there's probably a better solution, but to answer your direct question about how to automate the "unplug this cable, plug in that one"...
How about plugging all four cables into a managed Ethernet switch, and then tell it to disable the ports you don't want? That'll avoid any IP-layer shenanigans. You will need to have a box somewhere to run the script that pings things and then reconfigures the switch when it decides it's time to failover.