I think you need to copy the list. Your code above just references it. I forget how exactly but a searching for "JavaScript copy array" should give a way. Also when setting the sol you'll probably want to push a copy of the current sol first. I think there's a runtime function for that.
A useful reference could be to look at the "pick all" condition or maybe even the "pick by uid" condition.
For verifying the instances still exist:
One way that would work could be to find each instance in their object type's list of instances.
Another idea that could be investigated would be If instances somehow were marked as dead. If it wasn't then you'd need to check if the uid was the same. If it wasn't it would be a recycled instance.
Just some ideas. I'm not near a dev PC to try any out ATM.