usually timeouts are set for web requests. So using a script to restore a large file like you say is probably not the most reliable way. Use ssh and shell command, it would be more reliable for this.
Well I made a few assuption, one was that you script/db is on a Unix like host?
You have to check if you get ssh access to you account, if you are not on a dedicated server. If you do and you are running windows, search for putty.
Since it seems you have not used shell before, you may want to send a request for help to your host, and/or also hire someone to give you a quick hand with the restore.
You could also make the script execute the ssh/mysql commands for you. I have backup/restored nearly 1 Gigabyte databases for users who who didn't have ssh access and were unable to get it done via phpMyAdmin or any other way.
Ssh (Secure Shell) is a program to log into another computer over a network, to execute commands in a remote machine, and to move files from one machine to another. It provides strong authentication and secure communications over unsecure channels. It is intended as a replacement for rlogin, rsh, and rcp.