First of all, I'm back. Yay. Huzzah. Go eat a cat if you'd like.
Second, as far as detecting this 'ere stance thingy it's actually very simple. It's painfully simple actually, I have no idea why no-one has ever figure it out these past five years. And not only is the method of detecting the stance very simple, there are even two ways of doing it. It's so simple that anyone can figure it out. In fact, you'll probably hate me for not saying such a simple thing these 10-12 months that I've known about it. I don't really have an excuse for that. Well, I have, but that'd mean I have to tell you my whole bloody life story (seriously) and we don't want that.
Notice how I sort of delay the whole thing by writing loads of stuff nobody cares about? This is to create tension for the big climax. Also, it makes the post looks long and that makes me look cool.
Here it comes.
The big climax that is.
The answer is the animation itself, and how it effects the unit. There are two noticable effects to the unit, hence the two different methods of detection. These are angle (getDir, doesn't work on human players) and velocity (speed). See, when a unit goes prone/crouched he is still moving in some direction and his angle is tilted slightly. What's great is that these values are consistent. Even if you go prone/crouch a hundred times, as long as you use the same animation, the speed value is going to show up exactly the same all hundred times, and the angle will tilt with the exact same value every time, wether you check the values in the start of the animation or the end of the animation.
Both methods have a slight, slight chance of failing because these exact values can be reached (however extremely, extremely unlikely) by other means. Speed is the most reliable one but if you wanna be on the safe side I'd recommend you use both.
Here's a list of the speed values with the official animations:
Standing-To-Prone: 2.26923
Crouched-To-Prone: 1.05517
Running-To-Prone: 6.64739
Crouched-To-Standing: 0.386415
Prone-To-Standing: -0.147613
Crawling-To-Standing: 4.25231
While testing these values while I wrote this I discovered that the values change while not on flat ground. Sorry to disappoint you, it came as a suprise to me as well, 'cause I had tested this on that pesky flat ground on Desert Island like loads of times. Whoa, do I feel stupid, but now at least we have something to work on. I personally haven't done some serious scripting in like a year or so (this discovery was about the last thing I did before I retired), but I am confident someone can perfect this method.
There is still one possibility that I can think about, although it's not a nice one. It's an extreme workaround. That would be to setdammage the unit while standing still (if player, during a cutscene or something) to 0.8, see if the speed value changes even slightly. If it does, the unit is either standing or crouched. Then setdammage him back to whatever.
Humm...
Guess Trigs won the bet. Do you want 'em sent via the mail or should come and collect them personally?