If you can find which units cause the problem then you start a map with your terrain. Import safe data in this order: Buffs, upgrades, abilities, items, units, triggers. This way, the data will not have missing spells, items sold, upgrades and the triggers won't have missing units and spells.
You can do this by importing and by copy/paste. Use the window tab on the tool bar to alternate between maps to cut and paste. It's just like importing a spell for the first time.
You should only need to recreate bugged units. I think you may be right that you merged data that had the same unit/ability IDs. I would think that JNPG would account for this, but maybe not. It might be a good rule not to merge custom data set with other custom data sets of the same type. Also, have you tried doing what was suggested in the thread I sent? It recommended deleting all the units placed in the terrain and trying to delete units from OE after that.
I found this too:
http://www.wc3c.net/showthread.php?t=78751&page=2
It suggests the problem may be with the w3u file. I think that is the unit data file, but I am not sure.
If the issue is in fact having multiple unit IDs, then have you tried hitting CNTRL-D and looking for duplicates?
I have also seen suggestions that more than 300 units can be a problem itself. How many custom units do you have?
I prefer make special spells with slow stunn but for miss, silence, magic resist
But for my map it's a bit complicated because it needs more spells and the world editor use it with specials systems, this map already uses a lot of memory so I tried to make it as simple as possible