It’s really difficult to give help to others without the actual file in hand.
See point 3 here Help Us Help You
(recreating a set of data, 2 datatrees in this case, is bothering enough that make one avoiding trying to help completely…)
This said, you are lucky your data are points!
Use groups.
By using groups you can handle whole branches as single objects, and so you simplify your datatree structure enough and in your case you will just handle simple lists.
Then lastly do ungroup to retrieve your actual sorted datatree.
Do a distance check to your single point, if distance is smaller than 0.001 then you get a “true”.
Do mass addition, the only branch with a “1” will be the branch that had the point.
etc etc
weave list A with list B.
ungroup
EDIT: Not whining or anything, but writing this post of mine require way more time than probably making the actual solution on grasshopper.
If you attached your .gh file with internalized data both of us would have spent less time writing/reading and you could have already a first working solution.