Will a Contingency/Dimension Door combo save me from breaking a Staff of the Magi?

My wizard has a Staff of the Magi one and is itching to break it over his knee. But he values his life and wants to maximize his chance of survival. If he casts Contingency with Dimension Door – specifying a location far enough away from the blast – there is an argument that the spell goes off before the explosion or possible Plane Shift. How would you rule?