Using Serial imput to run a code

      if else (currentMillis - startMillis > oneSecond) {
          currentState = MM_SORT;
        }

Your code from eply #69 does not compile (IDE 1.8.5). Error:

sketch_may24a:272: error: expected '(' before 'else'

       if else (currentMillis - startMillis > oneSecond) {

That should be a simple if/else as shown below

if (currentMillis - startMillis <= oneSecond) {
  ...
  ...
}
else
{
  ...
  ...
}

And why do you call checkButton() in mamdColor() ? you only have to call it in loop().