To avoid endless loop you could do the following:
1) Check at the beginning of blur event whether $grid.data("blurMode") == true, if true return
else
2) add $grid.data( "blurMode" , true ); and at the end of blur event remove it.
$(document).on("blur", ".pq-editor-focus:not(.hasDatepicker)", function (evt) {
var $grid = $(this).closest(".pq-grid");
if($grid.data("blurMode")){
return;
}
$grid.data("blurMode", true );
$grid.pqGrid("saveEditCell");
$grid.pqGrid("quitEditMode");
$grid.data("blurMode", false );
});