self.text:SetText('|cff000000This text is black,|r |cffff0000while this text will be red.|r')
SetFormattedText is escaping you data (best guess)
I copied your code exactly into my current panel, and it didn't work. I got "|cff000000This text is black,|r.." as the output instead of black and red text. Tried it on a new panel with the same results. I am not clear on why this could be happening with SetText and SetFormattedText :| any ideas offhand? or perhaps I should try a fresh install of the addon, though I don't relish replacing all the scripts written so far.