The hashchange event is fired asyncrounously, hashChangeEnabled is already reset to true when the code in the event handler is executed. You must reset your hashChangeEnabled in the hashchange event:
if(that.hashChangeEnabled == true){
stateObj = event.getState()
that.stateChangedHandler(stateObj);
}
else {
that.hashChangeEnabled = true;
}
In your updateURL function, you can check if the hash has changed:
if (hash !== $.param.fragment()) {
this.hashChangeEnabled = false;
$.bbq.pushState(hash);
}
reset hashChangeEnabled with setTimeout (, hashchange , )
this.hashChangeEnabled = false;
$.bbq.pushState(hash);
setTimeout(function() { this.hashChangeEnabled = true; }, 500);