I am not even sure it would work with hum either. What makes you think the hum in a track and the inverted hum that you create are going to remain in phase over the whole course of a track. At some point they may drift timing wise and then you will no longer get full cancellation.
A better way to go would be copy the track to a lower track and then filter very steeply everything below and above the hum so all that is left is just the hum. Then invert that and add it to the track with the guitar and hum and as they are in phase it would more than likely work better.
Hum can also be treated perhaps with a very steep notch filter. It is not going to effect the guitar sound much but will rid the track of hum. The good thing about hum is it is only one frequency (perhaps two, sometimes you get 60Hz and 120 Hz components in hum (or 50 and 100 Hz in our case, better BTW) and very constant.