10 turns is plenty of time, in the later eras, to set up a massive ambush.
That said, teleporting units out of the territory when you declare war was always a massive kludge, if you can solve this by having the AIs be much less tolerant of units in their territory, while still allowing the occasional passage or attack on a third party, that would be better. I am just cautious since this was a huge problem in Civ 3.