I have looked at the page and the die statement is in the rite place. If this code runs you will not have any records insert, the execution of the code will stop at the die statement. This tells me that maybe you are not testing the page correctly or have not uploaded the current copy to your server. As an extra test of this you can add in another die statement to confirm if the insert server behavior is being triggered like this:
starting at line 143:
// WA Application Builder Insert
if (isset($_POST["insert"])) // Trigger
die("the insert has been triggered");
Please add this to the page, then save and upload the page before you test it. If you are triggering the insert then you will get this message. If you get this message then you should go back into the page and remove this message to allow the rest of the server behavior to proceed. If you are triggering the insert and have the die statement for the sql in there like it is now you will not get any records inserted, you will instead stop processing at that point and print the value that is in the sql variable.