Actually timout is not a problem in this script.
The main point is howto optimise and shorten the process. Instead of grepping all submission response thru a slow proxy, I just want to grep a very first line of it and move to next proxy server. Howto do this? This is the main problem ;-)