When dragging any node onto a cable, so that it covers that cable MNodes shall display a dashed cable connection during that operation before dropping the node there of a connection (or multiple connections) that COULD be made if dropping the node there.
This dashed cable is the connection that would finally be made when you release the node in this place and confirm your wiring choice. MNodes shall use the first matching In / Out pairs to insert that node into the existing chain at that position.
When the dropped node is touching more than one cable at a time then ALL affected cables will be potentially mapped to the dropped node.
Do not connect the cables automatically on releasing the node but display a little dialog that ASKS the user if he / she wants to insert that node into the chain and auto-connect cables. Maybe allow to filter cable types manually to prevent accidential wiring while covering undesired cables.
With this feature you could quickly place fresh modules between others without needing to wire them up in many cases.
Btw: It might be useful to require that the user holds a modifier key (ALT?) to enable this auto-connection mode. This way you don’t get annoying false-positives when dropping a node elsewhere.
Also the modifier (ALT?) would have the benefit that you could implement the opposite: when dragging a node and pressing the modifier it gets removed from the chain (gaps closed + re-wired as good as possible) when releasing the node again.
The mini-dialog on auto-connect for being able to uncheck cables that should NOT be included in the action would still be nice even when a modifier has to be pressed when initiating the action.
As a modifier initiates the action you can ONLY draw the dashed new wiring (and no longer the current one) that would happen after the drop during the drag op.
Using the modifier key in case of removing a node from the chain you don’t have to display anything when the user finally drops the node for confirmation (as you can see the result during the drag op and you have to manually activate it by pressing the key).
Note:
There might be cases that won’t allow re-wiring the nodes correctly. These cases must be handled in some way, e.g. displaying a “won’t work” icon at the node or something similar. Because some cases are too complicated to re-wire correctly.