The resistor is just there to limit the current flowing in the transistor base or the optocoupler diode. Shouldn't matter what value is unless it is way too big or small. It forms a RC delay to the circuit with the tranny capacitance probably no more than a couple of ms delay.