I think people are ignoring the intelligence of the fortress builders. Magic resistant architecture would be common. I don't mean enchanted walls but walls designed to resist magic attacks. You'd use layered walls separated by air, sand, soil, water, etc.
Disintigration is defeated by having sand between stone or earth walls. Sure, you destroyed 10x10x10 but the sand from the rest of the wall flows into the hole. Elemental spells are less effective against walls with air gaps because each successive wall gets to apply hardness again. Stone Shape fails against earth, Dig is useless on brick. Burrowing creatures drown when they breach cisterns in the walls.
Walls would be spaced out more and located farther from the main keep. Many walls would be of adobe or brick, materials not incredibly useful to the invaders that would have to be broken down to allow ready passage. The defender would have permanent siege engines with massive range (trebuchet anyone?) in excess of what most invaders could manage.
Mix in some trained animals and mystical creatures. Falcons hunt fliers in the day, bats at night. Some creatures may be dire (dire eagles, dire bats), others magical (groups of shocker lizards), and a few could be sentient (xorn or fey). These would be permanent fixtures at the fortress and no few of them would be secrets, possibly held only by the Lord's family.
These kinds of structures would be able to ablate a large amount of mystical assault, with or without onsite casters. If you remember LotR there were series of walls and defenses; that theory is sound and will be amplified but not obsoleted.