Firewall Port Forward Failover script

Hi,

I have two secure web servers on my home internal network.

I have created 2 firewall port forward configurations, both have the following:

one rule is enabled the other is disabled.
i would like to create a script which will look to see if the server1 port is open or closed, if its closed i would like to disable the rule, and enable the other. creating a failover for when maintenance is happening.
I can do this manually via the GUI , but would like to automate it.

The other would be to create a round-robin event - to load balence the traffic between server1 and server2.

Any help on this topic?