The thing is, they are unable to create AI intelligent enough, so that's why this scripting happens. Until they make big improvements with the programming of AI, they do these things to balance the matches, otherwise you'll just end up winning 5-0 every match.
This part that I quoted is actually not true. It's the other way around. They can make the AI so good that it will destroy any human player in any game and never make a misstake. Simply calculate all the options of what you can do from a position and find the optimal position for the defenders to be in to stop your attack. And in attack just calculate which one of your players is just an inch in the wrong position and exploit it. It's not that hard. A computer can make millons of calculations per second. But how fun would that be?
The hard part is making the AI make misstakes...sometimes. And then balance it to simulate a human beeing.
One of the first things you learn in computer programing is that it's no such thing as random when it comes to computers. There are already written random generators in almost every computer language and that you can use in your own programs but none of them are really random. They are more or less random to a human being depending on how well the programers made them and how complex and accurate you need them to be.
A computer is basically a calculator. If you input something it will calculate it and output something. This is the basic. A computer game is simply a whole bunch of calculations.
Asking a computer to do something random is very hard becouse what you're basically doing is asking it to give you a diffrent output everytime but for the same input. It's like if you would ask it to calculate 2+2 (which is 4) but you want the computer to sometimes give you the answer 5 and sometimes 6. It's just not logical!
As far as scripting it's the same for your goalkeeper. He has to sometimes make mistakes to simulate a human goalkeeper. Human goalkeepers also tend to do stupid things....sometimes. It happens to the best ones. They're human! Just look here:
https://www.youtube.com/watch?v=ZiMP2yvI8aI
The hard part is taking this into a computer game. Therefore I believe sometimes these "random" things can seem scripted. How could you make a goalkeeper misstake look like a misstake on a computer game without it looking scripted?
Also, f.i. IRL a team is most vulnerable right after scoring and it might be so that the programers took this into the equasion of the probability for when some things might occur.
I think the biggest problem with players that play games is that they would like their players to act like machines. But not the AI players.
F.i. You would want your goalkeeper to always make saves on certain type of shots, just like you expected your goalkeeper to save that simple ball but wouldn't get mad if it was a smashed shot into the top corner (and keeper in games thend to sometimes save those as well). But for a computer there is no diference between a "simple" ball and a hard one. It's just input. It's a bit of a double standard I think.
Also if goalkeepers in a game never ever made such misstakes then the game would not be realistic. The problem begins when they make huge amount of misstakes like the one you discribe. Then it's a shitty game!