It looks like there is quite a bit of custom code controlling the shipping. It is too hard for me to debug by just looking at it.
We would have to debug it in a screen sharing session after narrowing down exactly when it happens so we can reproduce it. I'd suggest a premier support ticket so that we can work with you directly on this and get it resolved.