May I suggest a slight alteration?

If the DM agrees, the secondary personality (or one of them) may be of different class as long as it has the minimum possible starting age, like a sorcerer. Additionally, that personality takes a -2 to Dexterity as, being a secondary personality, means that it didn't get much practice with the body. Additionally, the character may not take feats that directly oppose such personality; such as a feat the prohibits arcane magic while the secondary personality uses arcane magic.

In short, a different personality is a different person, so there's no need why it can't have different powers. However, in the case the class requires a lot of training, that's impossible because it is a secondary personality and rarely gets to show up.

Also, personalities COULD get to use different ACFs or class features, selecting different spells or maneuvres or even entire disciplines.

Shifting could also be possible to happen faster if both personalities agree or via skill or feat. It could represent repressed emotions or mental/emotional trauma that sometimes just makes a person snap and go nuts. An alternate personality may also get different flaws as long as they are of mental origins.

Yes, I know it makes things a bit complicated, but hey, that's life. Oh, and you may want to specify that an alternate personality with spellcasting should really spend an hour preparing spells/praying/whatever. Otherwise, what prevents someone from going through all his/her spells, switching personalities, repeating the process etc?