I did look at your commits briefly, and I have some questions / comments:
even when Recalculate shipping is false, there is some recalculation performed. For example, newShippingCostTaxExcl will be updated according to current carrier settings tax settings. That shouldn't happen -- in fact, I would not call the new updateShipping at all in this situation
when shipping is modified, then existing invoice would be updated. At least in my country this is very serious issue -- invoices send to customers must be immutable, and all changes should be done by new (corrective) invoice only
There is an issue with carrier selection -- if carrier was modified since the order was created, it will have different id_carrier (but the same id_reference). The original id_carrier will not be part of rendered carrier list, and therefore will not be pre-selected