I wouldn't really say that a more random AI is better. As you mentioned, the reason for randomness in AI is to avoid taking the same path repeatedly. There should always been an underlying logic, though. It may not make sense to you, but it'll be logic. Generally an AI scheme will look at the possible choices (i.e. move to this cover, move to that cover, stay here and shoot, etc.) and assign to each a point value relating to what it considers its goal. For example, move to cover A has a score of +10 because that's the average of all the leaf nodes for the game tree from that point. Stay here and shoot has a score of -5, still using the average, because it has a score of -100 on a directly connected leaf (i.e. the NPC dies), and a lot of low scores on the leaves farther down the tree.
A lot of AI schemes will always follow what it considers the optimal path at any given point. In other words, taking the one with the highest potential victory score. Some will follow path A with probability p
1, B with probability p
2, etc. with p
i summing to 1. Usually, highest scoring path will have the highest probability.
And then you have stuff like the FF7 AI, which has a very simple set of rules it follows. It's really just a big nested if-else. You can look at it on FFWiki.
Gezegond, the scripting you're talking about is coding. Don't argue semantics. The scripting Ray is talking about is more like scripting a play. If you're going to say that in-engine scripts aren't code, then C++ isn't code either. C++ is just shorthand (a script, if you will) for assembly code. Which are, in turn, just a translation of machine code. Therefore, it's only code if it's in machine language. Have fun with that.