maybe set the redirect to <pagename>.php?insert=true
Then add a php if statement to change the <body> tag
<?php if(isset($_GET['insert']) && $_GET['insert'] == "true") { ?>
<body onload="parent.Shadowbox.close();">
<?php } else { ?>
<body>
<?php } ?>