Make an instance Boolean the circuit branch sprite.
If it's overlapped by the black box, set the Boolean to false, if it is overlapping another circuit branch with Boolean false, then, it's false too.
The logic is simple and will always work on any new configuration.
I'll make a sample for you, but now I can't do it on the job.
Make sure to always overlap one pixel between each circuit branch, to check their contacts (like in a real world? lol)
Circuit is NOT overlapping Black Box;
Circuit is overlapping Circuit Family (or each circuit individually, sorry);
Circuit Family Instance Boolean = True;
---------> Set Circuit Branch Instance Boolean = True;
Then, you will have light!
Else, if the circuit branch is overlapping a black box, or, the another circuit branch is not already TRUE, then, it will not be true.
It's like following the energy path by checking the branch.
Also, the first branch need to be always True, because it's energized, alright?