Red box, not as you say, motor contains brushes, which spark as they travel over the segments on the commutator. As they are switching current in the armature coils, they generate back EMF, which are short voltage spikes that can be thousands of volts. These high voltages would break down the insulation within the triac. These components suppress these spikes.
diacs conduct when they have about 20V on them. So looking at your diagram, the green wave form gets to 20 V at T- 5 mS. This will cause the triac to switch on at T - 5 mS, which is to the left of your red wave form, the triac would then stay on until, T= 0, because that is when the volts across it fall to Zero. If its 50 HZ mains the triac would then conduct when T = + 15 mS on the positive cycle, even though the diac is now on its negative half cycle. So the triac is on for 5/20 of the time. Altering the time constant with the pot, slides the trigger point about, and hence the conduction time.
Frank