Suggestion: separate validation into a separate method
Currently the main submit routine deals first with validation, then with processing if valid.
I think it would be helpful to separate out the validation from the submission, as a bit of a code refactor.
I have a use-case which is a good example of why this would be useful: I wish to queue submissions for later processing to avoid database deadlocks on a very busy site, but I only want to queue valid submissions.
Currently, I can't validate the input without actually submitting it to the form processor for processing. If I could validate it I could then return validation errors, or queue the submission (for async processing by cron).