Some time ago, I have found that the use of JavaScript in the CommandButtoncustom button is good only for simple tasks (here i mean the standard page layout). For example, to open popup windows or alerts. If you runs complex task in backend, the page remains "frozen" for this period and it is difficult to perform the callback functions.
It is much better for me when i use an extra page for such tasks. Over there i am "the king" and can control usually all i need.
My conclusion: if possible use an extra Visualforce page and controller.