The area marked 1 will need to be repeated. The key presses are unique to each player, and need to be dealt with individually.
The area marked 2 can be generalised and doesn’t need to be repeated. Put all the player objects into an object group (P_Redpshyo and whatever other ones), and then replace all instances of P_Redpshyo in section2 with the object group name.