RGB Code not working.

Your setting of state is inconsistent.

sleep() sets state to 1, 2, or 3.
redIn() might set it to 1 or 3.
grnIn() might set it to 2 or 4.
bluIn() might set it to 3.

Serial.print() or state in each pass through loop will be necessary. Not jerking state around in all the functions will probably be necessary, too.