Claire,
For me this depends on how many words you are checking against.
In the most basic form you could have a rule on a field "if field A contains "word1" then set field value of field b". I can't quite figure out how you extract only specific words. I'm almost there with an excel formula, but I can't translate it to Infopath. Depending on your form "field b" could be a section with multiple fields that were specified in in field A.
Or you could set a field value of b to copy the whole text and conditionally format the words as required.
Also, you'll need a "submit" option of some description to easily close the form. Just have your default action (submit) to close the form. Although I always prefer switching views of a submit button. If a user fills out the form and it shuts down automatically, they will generally think they have done something wrong and try and do another form, or get hacked off.
Thanks
A