PlayerSay is your friend (and can be a pain, as you can break ALL OTHER CHAT based mods if not done correctly)
You'll also need to use a substring and find in text to look for the "[" and ending "]" in the beginning, then read the word in-between them.
As for how to do the output text in color, I forget exactly, but I'd look over the releases section for the Player Chat Tags release. It will show you basic methods for just about all of your needs of color and chat output.
We'd much rather you learn on your own pace than give you direct code.
Keep it simple.
A recommendation - Don't go full functions inside of hooks or functions like you did on the last SteamGroup challenge.
Where you did
hook.add (blah, blah, function ()
....
end) , though perfectly 'legal' in lua, can make it more complex to understand when trying to troubleshoot/read it later.
I'd recommend using hook.Add ( blah, blah, function_name ) below the actual function.
Easier readability. Easier to learn I think, can see where variables are being passed to function easier.
Just my .02. Some devs are likely to disagree.