The Script node is used when you need to create more complex Javascript code and it provides a few more capabilities over the Function node which can be used for simpler scripts. There is an extensive description of the node in the Javascript guide.
The inputs are defined by the content of the script or by explicitly specifying inputs in the properties. See the javascript guide for more details.
The outputs are defined by the content of the script or by explicitly specifying outputs in the properties. See the javascript guide for more details.