I recently encountered a similar situation - I have my CD collection archived in flac and converted to AAC files with foobar 0.9.5.1 and Nero AAC 8/07 release to put on my ipod touch.
After investigating the various ways of doing it, I concluded the cleanest way is to utilize Apple's SoundCheck. The mathematical conversion between ReplayGain levels to SoundCheck has been worked out already.
1. When using the foobar 0.9.5.1 converter, I checked "ReplayGain-scan output files as albums" - which will scan and insert the four ReplayGain metadata tags in the output files.
2. mp3tag 2.40 has a very nifty function rg2sc that converts ReplayGain to SoundCheck. You can take advantage of writing a simple little action to batch convert files. First add all the files you wish to add SoundCheck tags to the main mp3tag window and select the files.
Under Convert, Actions make a New Action Group. In this Action Group, you will make the following two Format Value actions.
Field: COMMENT ITUNENORM
Format String: $if($eql(%_extension%,mp3),$rg2sc(%REPLAYGAIN_ALBUM_GAIN%),)
Field: ITUNNORM
Format String: $if($eql(%_extension%,m4a|mp4),$rg2sc(%REPLAYGAIN_ALBUM_GAIN%),)
2a. You can change the REPLAYGAIN_ALBUM_GAIN to REPLAYGAIN_TRACK_GAIN if you prefer ReplayGain Track Gain instead. This will most closely mimic SoundCheck's performance. Also note the the SoundCheck tag is different for mp3 files and AAC files.
2b. I have found that insuring your metadata tags are as complete and accurate as possible is a good step at this point and mp3tag makes this very easy.
3. Start iTunes and enable SoundCheck in Edit, Preferences, Playback, and also on your ipod. iTunes will insist on converting your existing library (canceling the operation will only have try to scan every time it starts), so you may wish to trim your library before turning this on in iTunes or use foobar and mp3tag on your current library before turning on SoundCheck.
4. Import your newly minted mp4 files into iTunes. iTunes is smart enough to see the SoundCheck tag in the imported files and not rescan them.
These mp3 and AAC files have the advantage of having both ReplayGain and SoundCheck data in them, allowing the optimal playback based on whatever player you use.
Good luck!
Bing