Not sure if correct forum, but, I was picturing a script or expression that would allow for mask manipulation by another mask, based on which side the "secondary" mask comes in contact with the "primary". So, the first pixel of the masks that touch, if its last coordinates were 1 pixel lower in x screen position, it would alter the primary mask so that it appeared as though the secondary masked object was moving in front of it, and if the masks came in contact and the secondary's previous pixel location was 1 pixel in x position higher, it would not affect the primary mask, appearing as though the object went behind it.
For orbiting type scenes. The secondary and primary masks' positions and paths and size could all be calculated to determine when the mask should "appear" from "behind" the primary mask.
I think that this variable of the previous pixel location for the mask determining how they interact could also be used for other situations, too. Auto trace, too, could use the feature added. I think the information is already there, just not used, that way. You could then have many auto traced objects from different comps or projects that could immediately interact with each other, correctly as soon as dropped into a new comp.