Alatak,
your fix works for me (as tested by youself) with this slight difference:
with the old file the page was normally redirected to paypal (with a lag of 2 or 3 seconds) and, if not, there was a button to force the process, while now there is any possibility to push the button (and there is no lag).
Actually for me this is not a big dirrerence, and the main thing is that the customer could reach the paypal page. Even though I have to admit that the previous behaviour seemd more effective.
Please, let me know if you don't need my test site any longer, so I can delete it.
Thank you!