How would I change the 10 MB limit to 5 GB in this script?

You have to set PHP upload limits properly.

Calculating 5 GB in Bytes would look like:

$5GBinBytes = 1024 * 1024 * 1024 * 5;
// or nicer
$5GBinBytes = pow( 1024, 3 ) * 5;

5GB is a lot of data, which might take some time. There is a good chance you have to crank up process time limits – max_execution_time and max_input_time come to mind – and memory_limit as well.

As per comment by @swissspidy, WordPress defines the constant GB_IN_BYTES, usage:

$5GBinBytes = GB_IN_BYTES * 5;