Could somebody explain to me how MP3gain works within MP3tag.
I have insatlled it as a tool and it runs ok but the command prompt screen closes before I can see the results.
Does it pupulate a field in MP3tag?

WHo knows? But you can check in the Extended Tags dialogue (press Alt-T).

Second, if you try to use that program from within MP3tag: how did you include it?
Have you checked, what kind of parameters have to get handed over in the command line?

When you process an Mp3 file with MP3Gain it writes an APE tag, so make sure you check the APE box under Read in Mp3tag.

I use Foobar2000 to do tag-based ReplayGain for both track- and album-leveling (NOT hard-coding the new levels in the audio encoding itself) and IMO that's the way to go.

I believe it uses the native ID3/Vorbis tags for MP3/FLAC respectively rather than APE.