The problem lies on this line:
&& !jQuery(e.target).is('.ui-dialog, a')
You are asking jQuery if the event target is an "a" tag or an element with class ".ui-dialog". Remove the "a" tag in the selector as follows and it should work as you want it to.
&& !jQuery(e.target).is('.ui-dialog')
Here's the modified fiddle http://jsfiddle.net/PRQNY/1/
P.S: Just to confirm your understanding of events. All events bubble up irrespective of the element tag in the standard DOM event model.