Thanks for the info, this tells me that you have validations that are failing on the page. The validations that are failing on the page are the CAPTCHA and the security question. There should be some validation show if regions that will let you know that these values were not entered correctly.
Please try removing the debug code and testing again to determine if you are getting the validation errors to show on the page.
If you want to make it so the fields retain what was entered into them you will need to set their values like this:
<?php echo(ValidatedField("contact","Contact_Name")) ?>
<?php echo(ValidatedField("contact","Email_address")) ?>
<?php echo(ValidatedField("contact","Comments")) ?>
The security code and question should not be defaulted to the previous values.