Your code works, with a couple corrections:
After BACKGROUND-COLOR: there is no quotes; the quotes come after the color, so remove the "".
On one line you refer to lngStartPos as lngLinkStartPos that will give an undefined variable error.
For myself, I have a base text css style that affects all unformatted text (body tag redefine) so by using your code, <FONT style="BACKGROUND-COLOR: #000000"> was being replaced and left with <FONT >. This caused the affected test to "ignore" my css rule. So, I had to adjust the code by adding "<FONT " to the front of the search string and upping the Mid counter from 33 to 40.
This may cause havoc if you allow users to edit their own font attributes as I'm not sure how the font tags are combined...
Personally, I remove font choice, size and colour as it's quite ridiculous what some people consider attractive for reading. I prefer to have my css dictate the formatting. They still have bold, italic, and all the buttons, the rest is handled by css.
Edited by Sliv