Within a script, no, it's not possible to switch freely (because that implies closing R and opening a new session with a different version). But it's possible to have several versions of R installed, and, when starting RStudio, to choose which version to run.
There are instructions here, in short you have to define the environment variable RSTUDIO_WHICH_R.
If you want to always open a given project with an old version (and all other projects with the most recent version), it should work by creating a bash script containing:
RSTUDIO_WHICH_R=/path/to/version/of/R Rstudio /path/to/project.Rproj
(I don't have a Linux install on hand to test)