You've got the jist of it.
textContainsRatingValues is just a pseudo function. Replace with your own logic!
Yes, all the text is returned as plain text. Apart from not using == to test equality, the immediate error is that you're testing whether the whole string equals "Critical Strike", rather than merely includes it. You will need to use string.find or string.match, which can also be used to extract the relevant numerical value from the string.
You can read about it here and/or ask for more information.
http://wow.gamepedia.com/Pattern_matching
Couple more things.
elseif needs to be one word, otherwise it's
else with a nested
if. When replacing the text on each line, you probably want to include the existing text as well.