An AI doesn't need to do this.
Source: Ex pro Starcraft (Brood War) gamer.
I always wondered why they do that, just spam meaningless things like open/close the stats window or click on the background. Some WoW PVPers did it too (like Laintime, I think it was - played a warrior and ran around spamming the character window open/closed an mashing 'weapon swap' even when there was no earthly reason to do so). I figured it was just the result of too much caffeine for 18 hours a day.
This sounds like it's more an equivalent of tennis players' dancing/hopping around, or martial artists doing their ducking/weaving thing?
Similarly, an APM limit wouldn't directly imply that the kind of "gaming" that you're talking about, where a user/agent simply has to have an average APM over a certain period to be in compliance.
Similarly, just because the units for APM contains a specific time-frame (minutes) doesn't mean the measurement must be made over a minute. A 150APM limit doesn't necessarily mean that the running average over a minute must stay below 150 actions any more than a 65MPH speed limit doesn't mean that the running average over an hour must stay below 65MPH. If a police officer catches you going faster than 65MPH even for a single second (or however long a radar gun takes), they can pull you over.
The units of a measurement do not dictate how the measurement is made.
The point of the APM limit is presumably to fairly emulate a human player, but the APMs for humans are obviously averaged over a minute.
However, for certain things humans can initiate actions in SC2 in quick succession that, if sustained over a greater time period, would yield a ridiculous APM rate. Think a Terran player highlighting the barracks and tapping "A" really fast, say with a 10ms delay, that would result in 600 APM.
Let's say a human can build 5 marines like that in quick succession. You're going to have to allow for temporary spikes in APM to not unfairly give the human player an advantage.
But if you do that the computer is able to really rapidly execute more complex actions that the human can't because he's limited by the SC2 UI, whereas every action via the API is equally difficult for the computer. E.g. moving 3 different subgroups of marines out of the way of a High Templar Storm. I doubt any human player could select 3 different subgroups of marines from one big group and move them out of the way in 3 different directions within the span of 60ms (10ms for each action of select/move for 3x groups).
So any "fair" APM limit really needs to be dynamic in some way, or at least take into account the complexity of actions (say highlighting a group v.s. tapping "A"). It's not at all obvious how to do this while retaining fairness and not giving either the human or the computer an unfair advantage.
I believe the reason they use APM over APS is because 3.4 APS isn't as meaningful as 204 APM.