All I can suggest here is starting a bounty for a complete package rewrite. Apparently noone will touch the current buggy code, since it's completely unreadable mess. Unfixable.
Alternatively, get some blocklists in Squid's ACL format and use those.