There is already a Normalize script, but if you want to make it compatible in older versions:

A normalized vector has the same direction as the original, but has been shortened to a magnitude (length) of 1. Use the script in the image to normalize any vector.