start here
http://developer.gimp.org/
and
http://developer.gimp.org/plug-ins.html

but instead of the deprecated old script

i would use python as it is now built in
http://www.gimp.org/docs/python/