Hi Avi,
Do not use the revert statement. Leave it commented. In your first code piece, in the place where the docflow and status buffers are refreshed, do the following. This should be done only for orders which are not currently locked. In your code, this condition is already included. In this block, also call CRM_ORDERADM_H_INIT_EC. This will clear the API buffer(header). In the subsequent code, just make sure that the orderadmh entity is re-read. Reread will make a call to the API and the API will fill up the buffer fresh from database. I think this is already done in the reread_docflow method. The reread and bypass options should be as called as less as possible. If possible, do not use this in the getter methods. You just want all this to happen when the refresh button is clicked right? So finish the reread calls there. Just make sure that there are no problems. Eg: Try this in a new unsaved document and also try navigating via the docflow links after clicking refresh.
Best Regards,
Arun