The good thing is that MP3tag can do most of it for you.
Now: first of all you have to get the discnumber into the tags.
If you have a folder structure that has the cd-number in it
e.g. Beatles - Greatest Hits\CD1\01 ....mp3
then you can extract the discnumber with the converter Filename-Tag and the mask
CD%discnumber\%dummy%
Now you create an action (see FAQs for that, esp /t/967/1.
Instead of the field and text given in the example you enter the format string I gave you in post #3.
(Perhaps you try it out with just a few files and see if you are satisfied).
Then it is up to iTunes to find out that things have changed. Apparently it is easiest to delete the files from the iTunes library and re-read the folders...