How do I disable screen dimming *only during sunset*? Screen dimming is a great feature when moving to differently lit rooms. However, if the MacBook is facing a bright window, and the user is thus backlit, then the sensor goes haywire. 

I need to create some of script to disable auto-dim during sunset hours.  How can I access the dimmer feature from bash, AppleScript, or any other language?
This AppleScript may or may not work on your system.  On my Mac book Pro running the latest version of Sierra, this following code enables the "Automatically adjust brightness" checkbox If your current time is between 6 am and 6 pm, Otherwise it disables that checkbox If it is already selected.

if hours of (current date) is greater than 6 then
    if hours of (current date) is less than 18 then
        tell application "System Preferences"
            reveal anchor "displaysDisplayTab" of pane "com.apple.preference.displays"
        end tell
        tell application "System Events" to tell process "System Preferences" to tell window "Built-in Retina Display"
            tell checkbox "Automatically adjust brightness" of group 2 of tab group 1 to if value is 0 then click
        end tell
    else
        tell application "System Events" to tell process "System Preferences" to tell window "Built-in Retina Display"
            tell checkbox "Automatically adjust brightness" of group 2 of tab group 1 to if value is 1 then click
        end tell
    end if
end if
tell application "System Preferences"
    quit
end tell


You can adjust the hours values at the top of the script to suit your needs

If your display preferences looks like this picture... This script should work for you.