You can set the initial state of an object in the object palette. Put focus on the object, and under the Object palette their is a value tab. On the Value tab their is a Type dropdown, you can set its initial state there.
Scripts are tied to an object. Again put focus on the object. Open the script editor (Window/Scrip Editor or simply hit Cntrl-Shift F5). It will appear between the toolbars and the drawing palette. Now you are ready to script against the object that has focus. Choose an event (top left) where you want your script to run, choose a language (typically javascript) and leave the Run At parameter as client. All script for that event will be automatically written into the template for you when you save. You can change events and your script will disappear. All that means is that there is no script on th eevent that you are looking at. In the event dropdown, if there is an * beside an event that signifies that there is code on that event.
Hope that helps