Once the value of the mean is saved in the variable a very similar approach can be used for the RMSD. As you seem to prefer awk, see the following:
rmsd=$(awk -v mean=$mean '{++n;sum+=($NF-mean)^2} END{if(n) print sqrt(sum/n)}' my_file.xvg)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…