Because scripts aren't a valid solution. You need to program some awareness into the AI.
Simple scripts are contained and constrained by their very design.
Gee, thanks Captain Obvious.
Now at least try to use that hollow thing on your shoulders and think a few steps further.
You will notice that all the crappy dungeons are simply the result of shitty design. They need some more content so they just add some extra rooms with extra enemies, pat themselves on the shoulder and call it a day.
So obviously the solution is to improve the design, which can be done easily by making dungeons shorter. But then they actually have to create more content for their game and they would rather spend their time to make fancy graphics, sell more or licking each others buttholes and so we end up with shitty dungeons again.
Also there is no such thing as an AI, only the illusion of it. What is referred to as AI in games is just a bunch of scripts and consequently exactly the thing you think isn't adequate to make a good dungeon.
Further the “very design” of a script is simply depending on how diligent and smart the programmer was. Thats the point of a script: it does what it is designed to do.
You probably just wanted to use the term “very”, because you are so very uneducated.