If the hum varies over time, I don't think you'll be able to perfectly invert it with a separate sample very easily. You'd probably have to simultaneously record it elsewhere (but close by) and you might still get artifacts--though those might end up missed in the overlaid track.
Probably doable, but a lot harder than your method.
Made me think, what about audio compression? Psychoacoustic algorithms might want to alter the signal, or cut off the some of the frequencies entirely. This could make the record neither valid nor invalid according to this method, since the hum would be too altered to be a valid information source.
Probably doable, but a lot harder than your method.