You have slightly muddled the occurrence of events. Schultz has a flashback of the dog-mauling scene not right after Candie ups Broomhilda's(Django's wife) price, but later when the deal is being put to paper. In the violent moment where Candie threatens to bash Hilda's skull with a hammer, Schultz agrees to the raised price in a breath.
Later, when Dr. Schultz has a moment all by himself, sitting in the arm-chair, does he begin to experience the flash-backs of the hideous episode(dog-mauling). I believe he had those visions as a result of the trauma he had to undergo while witnessing the scene. The doctor was indeed a violent man, but not cruel and certainly didn't agree with slavery or Candie's methods.
Calvin Candie: Your boss looks a little green around the gills.
Django: He just ain't used to seein' a man ripped apart by dogs is all.
The climatic scene that you mention, was the repercussion or the end result of this flashback. Candie managed to antagonize Dr. Schultz so much over Broomhilda's deal and later(remember the insistence to shake hands) that he decided to pull the trigger.
EDIT: IMO, Schultz never considered the possibility (however remote or substantial) that Candie was going to kill them all. Rather than this being an act of premeditated self defense, this was more of an aggravated assault by Schultz not only against Candie's physical form but also against his misplaced ideals (read slavery, penchant for killing etc.).