[install script] Refactors NVM_DIR

After the PR:
* Uses a function to define the install dir (aka `NVM_DIR`)
* Does not replace an empty yet defined `NVM_DIR` variable, but uses a default value instead
* `NVM_DIR` is used at a single point in the install script

let's name this `NVM_INSTALL_DIR` - in ksh the local doesn't work, so the var will remain afterwards.