2). create a torsion angle and write that value to a file (Tools-> Structure Analysis -> Angles/Torsions -> select ->create->save)
Probably the easiest path is to use the "rotation" command to both create the bond rotation and to increment its value. You can use the Python equivalent of the "angle" command to get the torsion value after each change, e.g.:
from Midas import angle
dihed = angle(":241,a@CA,CB,CG,ND")
--Eric