Assuming you know Javascript then you need some objects to interact with in order for the script to do something. This document lists the objects you have available and what you can do with them.
jsConsole Use this object to interact with BlueJscript console
bluej Trough this object you can interact with BlueJ
html Use this object if you want to display some HTML
audio This object can be used to play short sampled audio files
utils WIthin this object there are a few useful utilities
jsEvent This object convey events that are aimed to the script
jsMenu You can add menues to the Tools menu using this object
constants Useful constants can be found here
There are a few keywords that are also available to the script writer.
print(...) Print a string to the console.
load(...) Loads a script.
jsleep(...) Sleep javascript thread for some milliseconds.