I think you're overcomplicating this. Additionally, I wouldn't recommend using the waitForBackgroundJavaScript
method either. Furthermore, the HTMLUnit API itself doesn't recommend it.
I've explained in this question a better and simpler way to work with AJAX:
Get the changed HTML content after it's updated by Javascript? (htmlunit)