Apple's tech note on how to write a scripting addition:
A seminal article from MacTech Magazine:
Useful notes from an experienced scripting addition coder:
Sample code for creating a scripting addition: