Edit the code so that it takes multiple lines of text, or call the script for every line.

I don't think you are going to find any free decent translator anyway, usually it's just words, maybe a sentence, but rarely multiple sentences.