PHP shouldn't time out just because a download takes too long. Also, apparently this file had a lot of whitespace at the end of lines which has been conveniently removed now.
Thanks for working on this. Unfortunately this did not make it into the final release of Joomla 2.5, or it was handled elsewhere, so this is being closed. If you feel this is still a valid issue in Joomla 3 please create a new issue.
This is the 2.5 version of #1668