For the syntax highlighting part, the first thing you’ll need is a lexer (lexical analyzer), which will be able to tokenize the source (script) and yield back keywords such as things like: number, comment, operator, built-in function etc. that can then be used to change the color of the desired words (parts of the provided source). Each tokens’ source text color can be changed using a separate textlabel (for different colors), or when we get rich text support, which seems to be soon, you could use that and it should make things even easier.
There are a many ways you can write your own lexer, but maybe doing some research on how lexers work and can be built in general might help?
This also might be a good starting point (or all that you need)