You run a pretty substantial risk of seeing a lot of false positives with that particular code snippet.
After having been actively working on this for a long time, I think it’s safe to say there’s no easy bulletproof fix.
I have addressed this problem with my new upcoming faucet service. It’ll be 100% free and you’ll be able to screen for several different things, proxies is only one of the variables. Any faucet script should be able to use it but the exact implementation will naturally differ with each individual case. No worries though, it’ll be super easy, almost plug and pray. Release schedule, sometime this January.
(Once I have my new faucets scripts available for the public, it will really be plug and pray.)