I doubt that thing is a resistor. Likely a capacitor which was intended to absorb the backflash voltage of the coil. Coils, when de-energized can produce a high voltage reverse voltage. THe cap will absorb it and feed it into the coil slowly.
I say slowly but all of this goes on in less than an eyeblink for small devices like this..
The red and black leads are an indicator. Resistors do not care about polarity, many caps. do.