Could you do it through Javascript, not sure if it will work but something like:
<?php
print "<script> document.write('Please wait 30 Seconds') </script>" ?>
This may then write just before the script is executed.
I'm not sure if it will work but it is worth a try.
Or maybe just use javascript:
//Code before
?>
<script> document.write('Please wait 30 Seconds') </script>
<?php
//Continue with code