I guess the next step is to start debugging... add code after the IF statement like:
// WA Application Builder Insert
if (isset($_POST["Insert_x"])) // Trigger
to see if the trigger is firing at all.
If it writes the code to the page, then try removing it and adding the die later in the code. It seems like it would have to be a problem with the button name.