Different between loadentity and afterloadentity

Simply the loadEntity function is called before afterloadentity.

loadResponse: function(data) {
    data = data || {};
    this.onLoadingData(data);
    var entity = data.Entity || new Object();

    this.beforeLoadEntity(entity);
    this.loadEntity(entity);
    this.set_entity(entity);
    this.afterLoadEntity();
}

In beforeLoadEntity the entity isn't yet loaded. In loadEntity the function return the entity loaded and set data on property grid, in afterLoadEntity you can act on entity before the form is displayed.