There is a simple way to compare two business objects for equality, the string representation of xml of two complex variables or list of complex variables will exactly be same if their contents are same
make a copy by value before editing
tw.local.savedcopy = tw.system.serializer.fromXml(tw.system.serializer.toXml(tw.local.originalvariable))
compare as
if (tw.system.serializer.toXml(tw.local.savedcopy).toString(true) == tw.system.serializer.toXml(tw.local.originalvariable).toString(true)){
;
}