Adjust the exposure slowly over the span of several pictures, or
See
http://chdk.setepontos.com/index.php?topic=3079.msg31644#msg31644 (don't let the name confuse you, it's good for generic day time intervalometer use). That script uses the raw buffer shot histogram scripting functionality of CHDK, which is probably the most accurate way of knowing whether your shot was overexposed.
And then there's bv (brightness value of the APEX system as perceived by the camera's autoexposure algorithms) of course, available via get_prop.