No, the functions for storing the order in the data base and sending the email do not need to be moved to the success page as long as they are after the Local checkout code on the confirm page, they will only occur if the order goes through successfully.
that code at line 107 gets the payer information from paypal.
to fix the issue, set the action of the update shipping form to pass any Querystring variables that are sent back to the page:
<form action="<?php echo $_SERVER["PHP_SELF"]; ?><?php echo (isset($_SERVER["QUERY_STRING"]) && $_SERVER["QUERY_STRING"] != "")?"?".$_SERVER["QUERY_STRING"]:""; ?>" method="post" name="update_shipping">