How can I edit the code?You would have to edit an already existing one. The one that the new Mega replaced, for that Spiritomb.
No one can do this, we'd have to edit the code and/or .cro dlls.
Same again, we will have to be able to edit music events, when and what music is triggered.