i think the quick test at the beginning of the script is a viable solution. but you need a certain criteria so that you can definitively say: proxy is up or down.
perhaps Net::Ping is sufficient to do it. perhaps you got to try to get a website which is responding very quickly. you will need some time for this.
an other way: AFAIK allows at least
squid to be queried via SNMP. perhaps this works (i do not know it).