You would have to make the spells you choose in SQL STDMODE 31 not whats posted above.
Then each spell needs it`s own STDMODEFUNC this goes in FLD_ANICOUNT 1-50
If you choose blizzard for instance, chance its stdmode from 2 to 31 in fld anicount add 10
Then in q-function
[@STDMODEFUNC10]
#IF
CHECK [flag] 1 [set to whatever class blah]
#ACT
ADDSKILL Blizzard 3
#SAY
congratz
#ELSESAY
You are not the correct sub-class
This should give you the basic idea.
If you want two classes to have one spell and one not o you will have to edit the script in q-function so that it works.