I found a way to get this done. I used the event listener
Code:rapidSpell.addEventListener('dialog_finishedcheckingtextbox', NotifyDone);
and added a method called NotifyDone.
This method will call the inline spell checker once the dialog spell checker is completed.