The solution, you have found, changes the color of the chapter entries according to their number, as you have already found out yourself, so it can't be applied to your problem.
The way I understand your problem, LaTeX won't be able, to solve it without your gentle help.
You said, you want to use colors in order to visualize the status of each part of your document. For example red would mean, this \chapter wasn't written, orange means, there has been some text added but that part of the document is still in progress, yellow could mean, that the writing process has come to an end, while the proof reading hasn't and green finaly is the color for a finalized version of your text? Is that correct?
In that case, you'll have to define an indicator, which stores the status of your text, as described above. Lets assume, you'll define this in you preamble:
\def\@status{0}
\newcommand{\statusnotstarted}[1]{\def\@status{0}}
\newcommand{\statusstarted}[1]{\def\@status{1}}
\newcommand{\statusproofing}[2]{\def\@status{0}}
\newcommand{\statusfinal}[3]{\def\@status{0}}
Than, the value of \@status could be used to determine the color of your TOC entries. You would have to define the code from the solution you've found here to this
\newcommand*\toccolor{%
\ifcase\value{\@status}% new variable used here!
\color{red}%----- 0 --
\or \color{orange}%---- 1 --
\or \color{yellow}%--- 2 --
\or \color{green}%---- 3 --
\else \color{black}%-- default
\fi}
The rest of that solution could be copied as presented, no need to change anything else. (Haven't tested it myself, though.)
EDIT: Usage in the document would be:
\statusnotstarted
\chapter{Introduction}
\chapter{Definitions}
\statusstarted
\chapter{Test Environment}
\section{Laboratory}
There habe been tests ...