Hey... that seems like a crazy idea...but.... why don't you put your script in /etc/rd5.d , it WILL be executed after X starts, it can be more complex cause in most cases the hard drive wont be hda, and it will work and you'll have a lot of less work..

boot from the cd

copy the files and dir's from the dir /KNOPPIX/ to a new directory

chroot for the directory where you copied the /KNOPPIX/ dir

put your sh in /etc/rc5.d from the shell where you chrooted...

make the iso there

burn it on a CD..

& it's done