[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

That's an idea as well, but not only is that a lot of extra cleanup, but that doesn't work if there's an existing variable set. If someone has `install_dir` set as an env var, even lowercase, we shouldn't overwrite it - and if we do, as in `ksh`, we may want to leave a value behind so that it can be used to trace where it's happening, instead of just clearing it.