There are multiple problems to solve here, mainly:
- While Geometry Proximity node will nicely calculate the distance to the nearest edge by finding the closest point on that edge, it will do so only for a single coordinate (Source Position); in order to get the minimum distance between two edges, you need either to use maths to calculate it, or (what I decided to do due to laziness) sample multiple points along the edge, and take the minimum.
- A common problem with Geometry Proximity is that it returns self: because the closest element to a particular element is just itself… So you need to delete self before using Geometry Proximity, and since geometries can't be fields, without a Repeat Zone you can only achieve it with preparing multiple duplicates of the geometry, and spreading them away from each-other so they don't interact by accident, and that's exactly what I do below. Since B3.6 there's also an Index of Nearest node that ignores self, but you want to ignore more than self, you want to ignore all elements from the same mesh island, and this node doesn't support it; it allows you to group elements together, but it searches within the group rather than excluding it :(
Notice how edges sharing the corner often light up simultaneously; they don't light up exactly simultaneously when the corner isn't the closest to the other island:
Since you refuse to define what you mean by "nearest", I can only guess. Previously I marked edges, on which there's a point, for which you can find a point on another mesh island, that is less than $x$ away.
Below a solution that marks edges, on which every point satisfies the condition; in other words, mark each edge, where for each point lying on this edge you can find a point on another island less than $x$ away.
Third time lucky
Mark each edge, which center is less than $x$ away from a center of some another edge belonging to another mesh island:
Replace the Group Output with the following setup to see the selection: