And here is how I check whether two brushes are touching: https://github.com/pwitvoet/mess/blob/master/MESS/Mapping/CollisionExtensions.cs#L7
I go over every face plane in both brushes, and check whether the vertices of the other brush are all on the outside of that plane. I return false as soon as I find such a plane. I also do a bounding-box check first because that's a fast early-out check.
Explained by Captain P: