I've given other people suggestions on how to do this with Tasker, but have always had OEM docks myself, and never really needed to test my suggestons first hand. Now I have an Otterbox Defender case for my Droid Bionic, and can no longer use the Motorola docks. Following my previously suggested solutions left my profiles lacking, so here I am with something that works well (for me, at least).

I prefer portrait mode when in the car, so the obvious solution was: if the phone is powered and upright, car mode is triggered; if it's powered and on it's left side, desk mode is triggered. It turned out to not be that simple, since the jostling in the car tended to confuse the orientation sensors, causing car mode to exit and resume frequently. What I ended up doing was triggering the different modes as indicated above, but making it so that the phone would stay in each mode as long as it's powered, regardless of orientation. Now once in car mode, the phone can get endlessly jostled, or even turned to a landscape orientation purposely, and it will stay in car mode. This makes the solution also work for people who prefer landscape orientation in the car - simply hold the powered phone upright until car mode is triggered, then rotate to your desired orientation.

Obviously you can add your own actions to the enter and exit tasks, but what's shown above is what I have, minus any actions necessary to integrate with other profiles.

In both cases (car and dock), the "activate" profile is activated by the contexts used originally - Power and Orientation. When either of these profiles activates, Tasker updates the %PACTIVE variable to include the name of the profile that activated. This in turn satisfies one of the contexts of the corresponding "maintain" profile. Since Power is a required context for either of the "activate" profiles, this means that the Power context for the "maintain" profiles is satisfied too. So once an "activate" profile is activated, the corresponding "maintain" profile is also activated.

Once a "maintain" profile is activated, Tasker updates the %PACTIVE variable to include the name of the profile that activated. Now, here comes the key to the whole thing - the fact that a "maintain" profile is active, satisfies the second context for keeping that very same profile active. This means that the only remaining context required to keep the profile active is Power. So, once activated, the profile will remain active as long as the phone is powered.

Also, each "maintain" profile disables the "other" "activate" profile, preventing the phone from switching between car and desk mode while the powered.