i dont know what he was trying to do when he started that spell, maybe letting a cutiemark appear? it the spell now works sounds good for the CMC. but the poor man never became a princess because he coudnt fix that spell.
There are a THOUSAND theories about what Star Swirl was like, and what he really did during his lifetime. My theory is pretty radical, and would probably never EVER be canon, but I like to believe it makes sense.