Basics
Drop 'Door animator.lsl' into the door, and you'll get a menu, from which you can set and test the open and closed position/rotations. When you click "Finish" it writes those data into the prim description and goes into normal click-to-open mode.
To get the menu again (eg to make adjustments), long-click the door. This only works for the owner.
To add sound, just drop a single sound file into the door prim.
There is also a script called "Door animator for windows", which allows a door with a separate window (or other attached) prim to move both prims together. To use this, set up both prims using the door animator so that they open and close by themselves, then remove the door animator from both prims, edit the door (main) prim, and add a notecard called "Door data", containing the (unique) name of the associated window prim. Add the "door animator for windows" script, and that should open and close both prims on touching the main prim.
Suppressing menu
In order to prevent accidental triggering of the menu, the pseudo-constant value ALLOW_MENUS at the top of the script can be changed to FALSE.
Remote control
It is possible to open and close the door from another script by send link messages with integer values -66353000 to open the door and -66353001 to close it.
Door types
A configuration card in the door prim with the name "Door config" can contain a label for the door, specifying its type. For example, the driver's door in a vehicle should have the line:
DoorType = "driver"
so that the vehicle script knows which door to open.
At the time of writing, this feature has not yet been applied to the windowed version.
To remotely open or close a door of a certain type, include the type in the string portion of the relevant link message (see above).