Medium base E26 (1") Lampholders are normally rated for 250v and can be wired for US 240v bulbs with two hot conductors, so screw color for polarization is inappropriate. However, NEC 410.50 specifies that when a "grounded conductor" (which is the name the NEC normally uses for the neutral) is connected to a luminaire, it shall be connected to ...
The red wire is certainly the supply (always-hot), and the yellow wire is certainly the switched-hot.
The red wire is a continuous wire that is hooked like a "U" over the screw. Don't cut it -- simply do the same thing on the new switch. This may take some fidgeting. Unscrew the screws all the way to the soft stop - do not force them farther ...
Your diagram does not use standard switch symbols so it is impossible to determine where the common pole (C) is and the normally open (NO) and normally closed (NC) contacts are.
You can see in Figure 1b that switching SW4 will short-circuit the live and neutral.
If you can redraw your circuit we may be able to help further.