So what you need to do is process php, send page, process more php all in one hit?
Tricky but try this for a bit of lateral thinking......
In the page that's sent to the browser add something like this at the end....
<IMG SRC="delete_file.php">
Listing for delete_file.php will be like this...
<?php
/ PUT THE SCRIPT THAT DOES THE DELETE IN HERE /
$id = ImageCreateFromGif('./spacer.gif');
ImageGIF($id);
?>
spacer.gif is a 1px by 1px transparent gif, so the file is created and the stuff is sent to the browser, when the page loads all the previous PHP has been done, the image call then loads the image which is a script that does everything you want it to and then send s a gif to the browser to keep it happy.
Remember that the browser is sent the html (or in this case the processed php) and then goes off and gets the images....
So long as you don't use PHP to write the HTML for this IMG tag, the first pass of php should ignore it as it is "normal HTML".