Is the text that you want to check static text or part of a comment or a
the main body of the document
OK, in that case the first part is not possible, as a script can't change the actual text of the file. It can highlight the misspelled words, but that's about it.
The second part is possible. You would need a script that iterates over all the words in the file and spell-checks each one (using a pre-defined dictionary). If a misspelling is found the file can be saved to another folder and the loop can be broken.
You would then use this script in an Action on your files.
I've developed a Spell-Check Suite for Acrobat (See: Custom-made Adobe Scripts: Acrobat -- Spell Check Suite ), so creating such a script and putting it in an Action should not be too difficult. If you're interested feel free to contact me (try6767 at gmail.com) and we could discuss it further.
No. You would need to use an Action (via Tools - Action Wizard) and then set it to save the files its processing as text files. You actually don't need JS at all to do it.