I think Distance_Restrain should work ok in v5. I just checked in an old version and the lines below worked. First thing to do is to check your topas.inc and make sure the macros are there. I'm guessing they will be from the error you get.
Do you have a complex multi-data set INP file that uses for_strs {...}? If so, you may have to be careful about where you put the restraints in an older version of topas so that they don't "appear twice" (once for each bank) when you do the refinement. You could try putting them in the str section of just one xdd.
prm !disttol 0.0
prm !distweight 1.0
prm !angtol 0.0
prm !angweight 0.000025
Distance_Restrain(Si1 0 O4 0 0 0 0 , 1.615, 1.61715`_0.00273, disttol, distweight)
Angle_Restrain(O2 0 0 0 0 Si1 0 O1 0 0 -1 0 , 109.4712, 108.05150`_0.23467, angtol, angweight)