I did something like this a while ago but I cheated myself around it. I had allready written the label of the CD with a pen on the disk so I just wrote a script that accepted the CD-label as an argument.
very simple...like..
"index.pl 34"
and boom.. a few seconds later all the songs from that CD were in the database with "34" as their CD-label.