to output console you can just change io.stdout to console handle, changing color is useless, but if you want it also can be done with color escape codes without using winapi. If darkp1xels console will not be open, no messages will be shown, which is generally not critical. Your script brings a new dependence, which is not good for lua scripts, because of stupid users. Also console may be accidentally closed, and game will be closed too. Using console is the worst way to print info for user.
You didnt do anything new