As far as I'm aware, you won't be able to save data from within the scripting engine. Which means, without using third party software, you couldn't feasibly do what you're describing. The AI we're able to put in will be unable to "learn" because it has no way of saving or storing information about what is going on. While a truly adaptive AI would be fun to develop, it's just not do-able.