Try just using setvar instead and see if it works for you.
If not the you can add this type of line to ant object you want to get rid of when done using it.
Using plrdistfurther condition to determin the range when you want the entity destroyed.
For example:
You have a dynamic object in your room. At the last part of the script have the last line that says:
:state=##,plrdistfurther=300:activateifused=1,destroy,state=1000
plrdistfurther=300 is the range of the players distance that you want the destroy to happen.
Activateifused=1 is for if you need to activate some other object before distroying this one.
Destroy - destroys the enity and the last state=1000 is to end the script loop for no further actions.