OK, until now the best solution I found is to run following command after changing scala version:
export SCALA_HOME=$(ls -l `which scala` | gawk 'match($0, "(/opt/local/share/.*)/bin/scala", a) {print a[1]}')
I have included that command also in my .bash_profile
so my SCALA_HOME
always points to the scala version I am using currently.
This command uses gawk 4.1.1 installed from MacPorts.