What I have done in the past is to change that check on the item tracking code to only check for 'open' item ledger entries. This way you can adjust the inventory out, change the item tracking code manually, and then put the inventory back in with the lot numbers.
It should only be a workaround, since a closed item ledger entry can be reopened through the application worksheet (so if you do that and apply an item ledger entry without a lot number to one with a lot number you might get into trouble).
This is a 'one line code change' in the item table, something like this:
IF (ItemTrackingCode."SN Specific Tracking" <> ItemTrackingCode2."SN Specific Tracking") OR
(ItemTrackingCode."Lot Specific Tracking" <> ItemTrackingCode2."Lot Specific Tracking")
THEN
//>> Olof
//orginal code: TestNoEntriesExist(FIELDCAPTION("Item Tracking Code"));
TestNoOpenEntriesExist(FIELDCAPTION("Item Tracking Code"));
//<< Olof