You can change all your /echo commands to some alias like /xecho. Then you just have to make an alias by that same name, and within that alias, do whatever comparisons/checks/changes you want. At the end of the alias, after all the changes are made to your text, simply do a normal /echo.

-genius_at_work