This is almost exactly the same situation I have. HP EliteBook laptop with Intel graphics. When in the dock, it's connected via DVI to a 27" HD monitor. The VGA connector is a secondary 19" 1280x1024 monitor. When undocked, the laptop LCD works fine. When redocked, video always defaults to VGA.
Not a terrible inconvenience, but takes a minute or two to load GfxUI and manually change everything. I'd like to have a small script I can click to set mode to "Extended desktop", set the primary monitor to digital display, and set digital display to 1920x1080.