I thought was for mixin externally provided systems like Homebrew, local is for machine or org-level customizations, and ~ is for user-level customizations.
The advantage of /opt is that multi-file software stays together. The disadvantage is that PATHs get long.