The problem is the Pick nearest. I've added some debugging to your CAPX: bht.hostingsiteforfree.com/bugs/rgb_beams_test_DEBUG.capx
You are picking at the beginning of the line, not at the intersect point, so the "nearest" on your second node is actually the first node.
I don't have a solution for you, but this should help.
Edit: off the top of my head, I think you are picking backwards. Check each Node, and then figure out which beams overlap.