You can use table maybe.
Create file "proxies", and table "proxies" with "load file proxies" and "save changes to file".
In the beginning of the run, template takes random proxy in table and delete line.
In the end of the template (GoodEnd and BadEnd) releases proxy: add it back in the end of...