The Element::Type
attribute is a read/write string, so you should be able to do this with a (diagram or browser) script. You might also need to set Subtype and some other things.
Interestingly, the API also omits StateMachine
from its list of permissible Type
values. It might still work though.
Either way, I'd say this is a bug and you should report it to Sparx.