NameError: global name 'rsr' is not defined
I am certain that it must be an script error, but I do not know how to
fix (I am not familiar with python script).
There is a great Python tutorial at www.python.org. You have an
elementary error in your script - you have to put your custom restraints
in the special_restraints() method - i.e. move the two lines starting
with rsr.add(... to immediately after the line starting with
self.restraints.symmetry.append(...
BTW, if you really have two chains in your model, you'll need to specify
the chain ID for each atom in your restraints or Modeller won't be able
to find it, e.g. NZ:38:A rather than NZ:38.