I have another variation, with all of the relevant code moved down to the <div> where the captcha fail message should appear.
This one displays the message in the correct place, inserts the record, and triggers the two emails.
But isn't redirecting to the thanks page....
So I have two that are nearly there but not quite....