How to show wait message that is used by actions

I’ve been having an issue where the blocking of the UI is delayed when a table row action is applied.  I looked for and found this solution to try and moved the blocking action inside the snippet rather than a standard block action on the “mutiple row action” that proceeds the snippet action call.

While it does work, I have the same issue of a delay where it actually completes the actions within the snippet and then blocks…not exactly very useful.  So my expectation is an “immediate blocking” occurs and then start the work that the snippet is to do.

I have a specific application using custom objects so you cannot run the snippet…but if you did, you’d see that the updates to the tables have completed (italics since I do not save) and then the UI is blocked.  This is about 1/3 of my overall snippet so there are two other updates and one row creation so the gap between seeing updates/row creation and the start of blocking the UI is more noticeable.  Across the entire snippet and row actions, there is no query of data or save of date…just update to records in models (these model have 1-4 records) and create rows.  So this is typically really fast and so I started with no blocking…however, there is a risk of click happy users doing so on row actions multiple times.

if helpful in offering feedback, I could point this snippet to a standard model and fields to make it clearer and to have the option to execute.

var params = arguments[0],$ = skuid.$;

// To start showing the message
$.blockUI({
   message: ‘Doing something crazy asynchronous…’
});
setTimeout(function(){
    // Turn off the block UI
    $.unblockUI();
},5000);

var model = params.model,
list = params.list,
selectedItems = params.item ? [params.item] : list.getSelectedItems();

var SelectDJModel = skuid.model.getModel(‘SelectedJob’);
var SelectDJRow = SelectDJModel.getFirstRow();

SelectedDJ_GroupID = SelectDJModel.getFieldValue(SelectDJRow, ‘Group_Id__c’, true);
SelectedDJ_TotalLength = SelectDJModel.getFieldValue(SelectDJRow, ‘Total_Job_Length__c’, true);
SelectedDJ_TubeDJ = SelectDJModel.getFieldValue(SelectDJRow, ‘DJ_Child_Name__c’, true);

//Grab key values for the selected tube DJ…where action is initiated…
//then update record to tie it to consolidated tube DJ and relink
$j.each(selectedItems,function(i,item){    
    ReplacedGroupID = model.getFieldValue(item.row, ‘Group_Id__c’);
    ReplacedTubDJ = model.getFieldValue(item.row, ‘DJ_Child_Name__c’);
    ReplacedParentDJ = model.getFieldValue(item.row, ‘DJ_Parent_Name__c’);
    ReplacedJobLength = model.getFieldValue(item.row, ‘Job_Length__c’);
    ReplacedTotalJobLength = model.getFieldValue(item.row, ‘Total_Job_Length__c’);
    ReplacedTotalJobLength = ReplacedTotalJobLength - ReplacedJobLength;
    SelectedDJ_TotalLength = SelectedDJ_TotalLength + ReplacedJobLength;
    
    model.updateRow(item.row, {
    Group_Id__c : SelectedDJ_GroupID,
    DJ_Interface_Status__c : ‘Submitted:Create DJ-DJ Link’,
    DJ_Child_Name__c : SelectedDJ_TubeDJ
    });
});