In the GUI app, select a region of text you wish to filter, and copy it into the paste buffer using Command-C. Then run the pipeline pbpaste | xyz | pbcopy in a Terminal or xterm window (where xyz is the filtering command, such as fmt(1) or par(1)). Then foreground your original GUI window (with the text region still selected) and hit Command-V. The filtered text will replace the original text. I think this adds a lot of power to all programs that have access to the Command-C / Command-V paste buffer functions. To save typing, I have shell scripts such as pbp, which filters the paste buffer's contents through the par utility.
Maybe some kind soul could take this to the next step, which would be to use AppleScript's do script command to map some key combination to one or more of these filters. This would allow some of the more common filters to be applied without switching to a Terminal window.

