For Java developers, there is an SDK to produce DroidScript plugins.
This SDK is in alpha test but it is perfectly useable.
It can be found here
For JavaScript-only plugins, which are much easier to create, see Create you own pure Javascript plugins