I think you complicate things too much. For me, it looks like what you want to do is a circular HTTP proxy load request between two squid services.
If it were me, I would not have written a byte of code or used something off the shelf.
I would use HA-Proxy with a configuration something like this:
global daemon maxconn 256 defaults mode http timeout connect 5000ms timeout client 50000ms timeout server 50000ms frontend loadbal bind *:3128 default_backend squids option http_proxy backend squids option http_proxy server squid1 192.168.1.2:3128 server squid2 192.168.1.3:3128 balance roundrobin
You may need to play a little, some web services may require certain types of stickiness, but this application is very customizable in this regard. HA-Proxy v 1.4 seems to support supported connections, which may simplify some of the corner cases I can imagine.
Oh, also, if you are trying to get the most out of your two connections, I would suggest setting up ICP between your two squid squares.
Matth source share