Out of curiosity, what kind of plants do you have? Some of the common ones like pothos grow from cuttings really easily, so you could periodically divide them, root them in water and have replacements ready if a plant dies. I feel for you though. I would not want to take all the soil out of my terrarium, but hopefully your spraying will keep the ants away permanently and you won't have to deal with this again.