If you want to fade back to the original colours then in place of this:-
if(step > totalSteps) step = 0; // start again
You could use this, again not tested:-
if(step > totalSteps) {
redIncrement = -redIncrement;
greenIncrement = -greenIncrement;
blueIncrement = -blueIncrement;
step = 1; // don't calculate the increments again but start at first change
}
By simply making the increments the negitave of what they were, you should be able to fade back to the the original colour.