There are several ways to hook a script up to "saving" a record. You can use a client script to attach to the "Save Record" event, which allows you to validate the record and prevent it from saving if necessary.
You can also use a User Event script and attach to either the "Before Submit" event, where you can modify any fields before the record gets to the database, or to the "After Submit" event, where you can take actions on other records after the record is committed to the database.
In either script, you can use the nlapiGetFieldValue
and related functions to retrieve information from fields on the record, and nlapiSetFieldValue
and related functions will update fields on the record.
Edit: Search the NetSuite Help for "Record API" to see the documentation for all record-related functions you can use.