Glad you figured it out. Within the shader language #ifdef is a pre-processor directive used to conditionally compile certain parts. The standard shader is really complicated so that it can support a lot of different options (like having a number of optional texture channels and lighting).
These are driven by options in materials, which you can turn on and off by using material:setOption(name, true/false). I wouldn’t recommend playing with them unless you know what you are doing. The USE_COLOR option is automatically set by the renderer when a mesh has a valid set of colors defined. Default meshes have colors all set to white, but it’s possible to have different attributes defined.
At some point if I get time I’d like to make custom materials easy to define in the editor / code.