I don't know what category to put this in, sorry. But every time I install a toolchain I want to use it from the command line I need to set the TOOLCHAINS environment variable, and I go through some awkward process in Xcode:Toolchains > Manage Toolchains… > hover over the right part of the toolchain in question and click the three dots > Show in Finder > ctrl click in finder > Show Package Contents > look in info.plist. Maybe there's a more straightforward method, but in that case the fact that it isn't easier to find is a problem: it should be on the Downloads page. And after all, why not just put the TOOLCHAINS setting in the text on the download page?
Then it's probably in /Library and not ~/Library, removing the tilde from the path in env var calculation might work, I just don't remember the exact path for global toolchain installations and can't verify it right now on the spot.
It can be saved in a script. But if the command stays in your shell history, then Ctrl-R to recall the command by substring (toolchain for example) may be good enough.
If I understand correctly, I think swiftenv might help. I've been having pretty good luck with it and its available from brew. I don't have to go look at Xcode after doing a nightly install anymore. I just ask swiftenv what's available and switch to whichever one I want.