you set the redirect at line 68:
$WA_redirectURL = "Builder.php?ID=" . $_POST["hiddenField"] . "&TempID=" .$_SESSION['HomePageTempMenuID'];
this is using the session that will be crated by the insert:
$WA_sessionName = "HomePageTempMenuID";
but that session does not get created till the insert completes at line 83:
$_SESSION[$WA_sessionName] = mysql_insert_id($WA_connection);
at line 85, though, we include code that will replace [InsertID] with the session value.
$WA_redirectURL = str_replace("[Insert_ID]",$_SESSION[$WA_sessionName],$WA_redirectURL);
so, change the redirect code at line 68 to:
$WA_redirectURL = "Builder.php?ID=" . $_POST["hiddenField"] . "&TempID=[Insert_ID]";