The easiest way to find the world space distance between two objects is to make a distanceBetween node.
First, make a distanceBetween node.
Then, feed the (object 1).worldSpace[0] matrix into the first matrix input. Feed the object 2 worldSpace[0] attributes into the second matrix input. Open the node in the attribute editor and set the "point" attributes to zero. (The reason this works like this is that the worldSpace matrix contains all the information necessary to transform a point in local space to world space. You want to compare the positions of the centers of your two objects, which are at 0, 0, 0 in local space.)
Finally, make an expression that turns off the visibility of one or the other when the distanceBetween's distance attribute is lower than a certain threshold.
I just tested the above, and it works.
The other way to do this, using the xform command to get the positions, converting to a vector, and using "mag," is a bad idea because using MEL commands like xform in an expression will slow down your scene evaluation considerably. Better to use the distanceBetween utility node.
-- Mark