Are you sure the F2 key is registering? If it's not, connect an external keyboard and try entering setup with the F2 key on that.
If it IS registering and simply restarting, There really isn't much you can do other than attempt to flash the BIOS if you can get it onto a USB flash drive from another computer. Hopefully Gateway provides a way to boot from the flash drive to launch the BIOS update.