I do find it funny, though, that even with proper indentation and comments, over 200 original scripts turned out wrong and stayed that way for 10 years.
Agreed, probably this is due to a sort of "stand in awe of Bethesda" effect, mixed with "if they (seem to) work don't change them", and the fact that some things that seem wrong or at least incongruent (= equivalent to == in comparisons, some extra endifs that seems to be just happily skipped...) probably produce the same bytecode as the "correct" version.
There are probably Bethesda scripts that were not written by programmers, and scripts that may be written in a theoretically more efficient way ( I say theoretically because I an not so sure that would be a noticeable difference in game)
Take the signrotate and the float scripts for example: they are widely used by lights and other activators, and even in the Bloodmoon revision, they are still calling a "slow" getdistance function each frame and using an unneeded swingTime variable instead of a constant value. I'm using a personal version of signrotate on street lanterns, that replaces the variable with a constant, calls getdistance only every couple of seconds (using getsecondspassed and a slighty randomized time interval so not every instance repeats the slow getdistance call the same frame), and even replaces the light with activator at daytime.
With all this optimization, what is the huge FPS gain in Balmora? Probably less than 1 FPS.
Anyway, rather than turn this into a philosophical debate, I've gone ahead and started a 'minimal impact' version which changes only the worst syntax errors and leaves everything else intact.
Keep up the good work!
Personally, I would also love a version daring to optimize code like the signrotate script... just without all my beloved indentation stripped
Here is a (maybe) interesting http://abot.silgrad.com/tmp/ab01speedtest.zip... what would be the 3rd script without sweet indentation?