Lua Code:
RED = "|cffff0000"
CLOSE = "|r"
editbox:SetText(RED .. "red text" .. CLOSE .. " normal part")
You need to color all text yourself. Or using some existed lib to do this. Search "FAIAP.lua", it's easy to be used.
BTW, I also have a lib to support the lua editor, with many other features, like double-click to select, undo, redo(based on the operation not time), an auto-complete system looks like(use up, down to select, use tab to select and cycle, just like sublimetext) :
Example can be found here :
IGAS-Cube