I just used this technique, baked it out, then painted over inset areas that wouldn't get chips. Maybe a variant on the Pits and Peaks script would work for finding the edges better?
That would be interesting. I wonder if you could add some kind of ray projection from the normal to see if anything was hanging over or protecting the edge. That way you don't get chips and dings in areas that don't make sense. Probably would need some kind of external script that ran outside of the shader and fed it some…