A number of 'hardcore' RPGs already allow something like this. For example, take a look at Dragon Age's Tactics - it's nowhere near a full scripting language, but it allows you to quite significantly change the behaviour of allied NPCs.
See I was thinking the other day about some kind of concept where you actually script your own AI, e.g. you control a bunch of characters and you can script their own individual AI using some kind of language (like choose a default target, what do to if the healer is being attacked, and being able to communicate with the other character's AI's and giving/receiving orders, etc...). Kind of like robocode but less academic.