...you can in theory (although probably not officially supported) write most of the logic of your game using javascript by creating a plugin with the SDK...
My understanding of this is that for third party plugins you intend to publish, you need to follow the rules set down by Scirra. This helps maintain consistency and prevents errors and bugs in later releases.
For private plugins, there really aren't any restrictions as far as I can see. If you are not planning on publishing the plugin, you won't break anyone's project but your own.
Building custom plugins for your private use (but for use in published games, obviously) is a great way to add coding to C2, in my opinion.
If I am wrong, someone please correct me.