I think there would be limits to the utility of this sort of thing. You haven't really outlined how this auto-discovery and topology-mapping process would work, but how would two sets of these boxes running in two neighboring apartments (within range of each other) know that they shouldn't all be part of the same network? Are you counting on all of the boxes being wired to each other to do this sort of handshaking? That's fine, but you'd lose the ability to wirelessly link different segments, which would seem to be a common reason for adding another device.
Why is your ex-roomate's box in the basement now, and why can't it just be relocated upstairs? I assume there's a cable/DSL/FiOS modem down there that it needs to hook up to? If so, running phone/cat5/coax as needed to get the wireless AP upstairs might be enough to improve his signal, and you'd avoid the throughput loss from WDS hops.