OK, I found some hints here about custom code Generation:
http://blog.lieberlieber.com/2012/11/05/a-custom-uml-state-machine-c-code-generator-in-600-lines/
This is a good starting Point.
You can also have a look at
Geert Bellekens' Enterprise-Architect-Add-in-Framework, which is freely available from GitHub.
I have put some extensions there for (behavioral) state-machines and also a utility class
'TransformationILWriter', you can use to generate a transformation template for a state machine diagram directly (unfortunately I didn't find out, how to set the 'Language' property of package/class elements using the transformation IL, so you'll need to set your custom language as default with the code engineering settings).
Note that state-machines need to be part of (embedded into) a class element for transformable EA UML domain models, and can't just be used from a 'free form' state-machine diagram. Thus you'll need to have a 'master' domain model class that contains your state-machine.
To use this, you'll need to create an EA AddIn based on the framework
in C# (which is easy) and provide a method that can be used with a
%EXEC_ADD_IN("MyAddIn","MyTransformMethod")%call, which is the only one executed at top level ('File' template).
Next step is to generate code from the transformed model as you need for the SPS syntax. Probably a good starting point for this is to start from the code generation templates for C-Language (or another non intrinsic OOD enabled language).
You might consider reverse engineering/synchronization support for your new language using the new NBNF syntax declaration feature for custom defined languages available with EA 10 (you might find some hints about this feature
here).
IMHO tracking down this path is the most promising way to get a working solution with least efforts (state-machine generation is not standards and depends on your EA edition license for the raw code generation templates).
HTH
Günther