Hi Ken
Although TextEdit is scriptable, its Find and Replace functionality is not. It's a sad example of Apple's inconsistent attitude to developing AppleScript in their own applications.
But that doesn't mean it can't be done. If the documents you're searching are simply text documents, then there a couple of ways to approach things:
Use a better (or more scriptable) text editor. Tex-Edit Plus from
http://www.tex-edit.com/ is my personal favourite. It has enormous scripting capability, its developer is committed to AppleScript, and it's very simple to use. Other options are TextWrangler or BBEdit.
It would also be possible (though unnecessarily complicated IMO) to script a word processor such as Word or AppleWorks to do the job.
The quickest and slickest way though would be to use AppleScript's file read-write commands from the Standard Additions scripting addition to modify the files. It's perfectly possible - and very quick - to work through hundreds of files in this way without even opening them on screen.
None of the above would need a shell script.
Post back if you want to pursue it.
H