when we first went to a load balanced environment I noticed this and had a big discussion with some with some my former PS Friends. Ultimately we came up with a solution that seems to take care of a load balanced change using just the alert set up with no javascript involoved.
You do this by setting your connection status metric group to pick up all the collectors:
(.*)\|Custom Metric Process \(Virtual\)\|Custom Metric Agent \(Virtual\).*
Then set your alert to Combination to All, use the Not Equal To Comparison and set the Danger and Caution to 1
We have found that 20 for 20 on the Danger and 12 for 12 on the Caution works most of the time. I have seen it where it takes more that 5 minutes to reconnect on a busy MoM/Collector Cluster but it seems to work most of the time so your mileage may vary...
We use the Whenever Serverity Changes trigger alert notification since these alert go to a high alert authority (NetCool).