I do not understand this sentence: "Resistor is used to stop loading the transistor"
The short answer is, as other commenters have stated, &quot;to limit the current through LED and the transistor&quot;. Here's the equivalent circuit of that section:



simulate this circuit &ndash; Schematic created using CircuitLab
!Q1 output of U1 can be at the level of U1's supply voltage, 12V.
From KVL, \$\mathrm{12V = V_{D7} + V_{R4} + V_{BE-Q7}}\$
So, the current flowing through these components will be \$\mathrm{(12V-2\cdot(0.6V))/660\Omega = 16mA}\$ which is quite acceptable for illuminating an indicator LED and saturating a transistor which drives a relay.
If R4 is shorted then D7 and the BE junction of the transistor Q1 will see the full 12V across them. Here's what can happen next:

The !Q1 output of U1 will see very low resistance. So a high current will flow through the diode and the transistor's BE junction even for a short time.
BE junction of Q1 (and thus the transistor) and/or D7 will break down which (most likely) results in a short-circuit.
Finally, the !Q1 output of U1 will see even lower resistance which may result in destroying the pin's output driver if there's no on-chip current limiting mechanism.