I did the same thing a few years ago, and it was lot's of fun. If you intend to use scripting then you must first familiarize yourself with Jython(Java+Python) scripting. There are lot's of Web Tutorials out there. Interestingly, "World" variables can be used as "global" variables in the scripts, so that data can pass between the scripts and Alice. This link will take you to an old site at Univ. of West Georgia that describes how to turn it on. After it is turned on, you right-click World, and select "Edit Script". That pane is where you put your script code.
http://www.westga.edu/~drocco/alice/
Unfortunately, Scripting will not work with any versions of Alice 2 newer than version 2.2. I have pointed out this, and several other self-inflicted problems, with the newer Alice versions including 2.4.1, and the Alice is supposed to be fixing them in a timely fashion.