Currently the blank line on line 22 would prevent the redirect. It could potentially be an issue with blank lines or errors in an include file causing the problem as well.
Remove line 22.
Open the Insert Record Server Behavior and then change the trigger in the list to use the "insert" button press.
Test that and let me know if you still have the problem. The next step in debugging would probably be to add this before the insert code:
if (isset($_POST["Insert"])) die("here");
And see if there is any blank lines or errors that are occurring that might be preventing the redirect.