I don't think it's quite as easy as mixing in some of the correct hum in to your recordings. The real trick is to eliminate the authentic hum (which reveals the recording to be altered) and then substituting the correct hum. Really you would need to have someone with decent mixing/audio engineering experience to get this right.
If it's just the 50Hz frequency, it's easy to make a cheap application with a GUI that computes the FFT of a wav file, replaces the value at 50Hz using some straightforward parameters (e.g home/suburban street/city center) and IFFT back to an output wav file.
I may be wrong but this sounds quite easy to fake...
That would still sound tampered because you'd lose any bleed over from other (ambient) sounds. Having all bleed over suddenly stop at 50Hz and then a clean electrical hum would look very suspicious.
You can solve this pretty easily. First, record the victim, and tamper with the recording as needed. Call this tampered recording "sample A". You need this recording to be somewhere that ambient noise will not vary much throughout the day.
Next, go to the same room (or a similar room) at a time when the victim will not have a good alibi and when the room will have the same basic ambient noise. Record using the same recording device in the same conditions (e.g. if it was in your pocket for the original recording, keep it in your pocket for the second recording). This is "sample B".
Take your recordings into Audacity. On sample A, apply the "Equalization" effect like this: http://i.imgur.com/gxPTV.png
Now mix the two samples. As long as the ambient noise does not contain easily isolated components like other people's voices, you'll have a convincing forgery.
Now you might argue that there could be other forensics techniques to detect this kind of tampering, but I would argue that if such reliable alternative techniques were available, this mains analysis technique wouldn't be particularly valuable in the first place.
I don't think that's taking into account the harmonic frequencies. The 50Hz buzz is not a sine wave. That means that even with that filter, both 50 Hz mains sounds should still be detectable in the recording. Unless I'm missing something?
Ok, so you look up the true signal for the actual recording time, subtract that from the recording, and then add the signal from the time you want it to look like. Voila: perfect bleed over.
And its frequency is not constant. You'd have to have some kind of adaptive comb filter to remove the original buzz with all its components. I've a feeling that would be tricky to do in a way that doesn't scream "photoshopped" (or whatever the equivalent is for audio).
It's not even that complicated and you can do it with existing software. You can take the file into something like Audacity, band stop the range surrounding 50 Hz (or 60Hz in the US), and then simply mix in the prerecorded mains sound like you would do any other mixing.
It's not necessary to mix in the frequency domain because mixing in the frequency domain is mathematically equivalent to mixing in the time domain (FFT(x + y) = FFT(x) + FFT(y)).
This might leave ghosting of the original signal and would probably highlight any fluctuations inherent to "the main" that the phase cancellation would miss. I think this would probably be one of the cleaner and easier ways to proceed though.