I’ve done it, but it was never as sophisticated as you are planning. I let the original loco wiring handle the lights and just fed motor output to the lead loco’s track pick up connection. I did sound too. I used one two-wire JST SM-2 connectors (same as Aristo Power plugs) for the motor line and a SM-3 3 conductor for the sound. Hid the wires in black shrink wrap to kind of look like hoses. No where near as pretty as what you have envisioned. Here is the front of one loco that was set up for M/U…
Power on the left. So I didn’t need to worry about plug polarity and allow either end to be an MU connection, I used that short double female between locos. Ugly, yes.