I tell people the dirt simple rule of thumb for LED's. Since a vast majority of the common LED's we are using for O-gauge stuff are rated at 20ma, the computations are simple.
Take the supply voltage, (assume 12V for rectified track power). Subtract the operating voltage of the LED from it, (3V for white or blue, 2 for green/yellow/red). Multiple the remainder by 50, that's the minimum value of the resistor. In the case of 12V, that would be 9 * 50 or 450. Since 470 is a standard value, that's the logical choice. For a single LED at any of the operating voltages we will encounter, you're pretty save with 1/4W resistors.
In many cases, I actually go considerably higher with resistors than the computed minimum value. Specifically for class lights/markers, I go to the 1K to 2K range, otherwise they're frequently as bright as the headlight, and they looks kinda' stupid IMO.
For the LCRU polarity issue, the easy way to deal with that is a small bridge rectifier and resistor, no more polarity issues.