Hate to be the one to give the bad news, but that's not possible.
Google Apps Script only helps with the Form creation process (and editing), it's not possible to do anything while the user is filling it, period.
Also, it can only do programatically what you can do manually on the Form interface, it's useful only to help you automate things that would be cumbersome to do manually. For example, adding a long list of options to a question, or helping you generate and email hundreds of similar Forms. Or just really creating quick quizzes or some other forms that you have to create every week, etc.
Just to be completely clear to other users that might read this. It's not possible to do anything with Apps Script for Google Forms that you can't already do manually. Apps Script does not add any new or hidden features to Google Forms.