You should go to the wiki and do a search for GSD. This is the Generic Serial Device. GSD scripts are written in Ruby, so if you haven't any experience with Ruby, go check out http://www.ruby-lang.org/
The basic premise is, you create a device template explaining what the device is, what commands it can respond to, and what events it should be able to emit. Once you do this, you'll get boxes for each command and event, so that you can write code to respond to them.