How to handle persistent level variables?

I have a c++ script that places persistent items in a level (for my game level editor). For example, the script places MESH X, and assign its property ‘ID’ a value Y.
When I’m tampering around the level, changing small details here and there, sometimes I notice that the meshes have their properties reset to their default values (zero in this case). Also arrays generated by the script get lost.

If my explanation is clear, how do you handle persistance? What am I doing wrong?

PS: being this is a crosspost from Blueprint Programming section, here are the other replies:

Anyone can give me some help on this?

Does anyone have any idea?