Download the app "Setting Profiles Lite". Lite is free and only lets you create 1 rule at a time.
1. Create a profile that changes the screen brightness to "whatever brightness you want" Save it as whatever name you want. 2. Create a rule. Under conditions add a condition for Battery that when "plugged into any charger", hit OK. Now add an action to Activate Profile, and choose the profile you made above. When plugged into the charger, the screen brightness goes to the level you chose, unplug it and the brightness goes back to whatever you had it set at.
EDIT: also what phone do you have? You might want to include it in your member profile so someone can help you faster. You can check the options under:
Settings>applications>development>stay awake or whatever options you have.
Not that it does the automated part, but you can set different brightness settings using Quick Profiles.
I use it to change profiles for daytime, sleep, meetings, and movies. It works be nice if it could do the automated part, but at least it lets you create profiles.