Yes; I guess I mis-understood the intended context.
Sounds pretty good. Personally, I'd be tempted to make the initial random value dependent on difficulty level (so it would be large at low levels, and small at high levels). I don't think that's essential, though; at worst, we penalize the AI further at the lower levels.
Hah! Great minds etc. I quote from my conversation with a friend on IRC last night:
(I just realized that would be in German, so I'll translate ;P)
[03:09:43] <Daniel> ich hab mal mit dem gedanken gespielt, das random value vom schwierigkeitsgrad abhaengig zu machen
[03:09:45] <Daniel> was haelst du davon?
[03:09:51] <Daniel> sprich umso leichter desto zufaelliger
[03:09:53] <Offenbarungsjoe> ich würds mal rausnehmen
in English:
<Daniel> I thought about making the random value dependent on difficulty level
<Daniel> What do you think?
<Daniel> That is to say, easier equals more random
<Offenbarungsjoe> I'd take it out completely for now
But I'm absolutely with you. Good thinking

RE: ATTACK_SEA. A bit sloppy debugging on my side here. What it actually checks is if there currently is no unit with standard unitai_attack_sea under the player's control; so if he hasn't built one yet, he gets the 200 bonus for each unit that comes with this ai. I agree though that this is an unwarranted bonus. I'd probably remove that logic completely.