From my own experience, just to clarify, this seems relatively easy to code. Knowing Crypt, who has billions of times more experience of coding more than me, he could probably do it faster, and more efficiently.
Let's break down the problems here: Say a trident lands in an enemy town, and that, for whatever reason, is a bad idea.
ProjectileHitEvent: this is something commonly used in Spigot coding to track when a projectile hits an entity or a block. In this case, it'd be used to track what and where the trident hit. If it hits a block or entity, get that block and entity's location. Check to see if that Location is within a foreign tile. If it is, you can "cancel" the event, meaning anything that's supposed to take place after the event (i.e. damage that's applied, or the riptide effect) is completely stopped.
So you're outside an enemy town launching a trident in? What about ProjectileLaunchEvent or PlayerInteractEvent? Either or, this would help you track what the projectile is and where the projectile is getting launched from. As before, check to see if the player belongs to the town that owns the territory tile. If not, easily cancel the event.
So what's my point? First off, this is a very rudimentary explanation of two coding procedures that can help solve whatever issue the tridents may cause, but keep this in mind: Snapshots aren't finalized editions. Who knows when 1.13 comes out? I'd imagine if there's something entirely game-breaking, Mojang still has plenty of time to fix it. So sure, it may be good to try to judge these flaws now, but in my opinion, it's kind of fruitless. Regardless, the solution is relatively simple (to my limited understanding).