As I said, I only consider it a viable solution for a one overmap tile fort, not multi-tile forts.
For a one-tile fort you can just throw a bucket of paint on the outside and see if there’s areas that remain unpainted, but for multi-tile that’s a no-go, for the obvious reason that it’d just keep greedily eating the whole overland map trying to find borders.
The pre-set solution you proposed is certainly the easiest one. It’s not terribly organic, but it is by far the most implementable.
Any more organic solution would need to handle that the fortification line can be from any point in a border to any other point in another border, so it’d need to consider if it matches the lines on it’s neighbors; not to mention, that there could be multiple lines, or lines that more resemble kudzus.
How do you propose to handle breaches? The first thought that came to mind is a flag system, flagging the overmap tile as, say “Fortified [corner/vertical/horizontal]” or “Fortified [corner/vertical/horizontal] (breached)”, and relying on the same “build a fort” menu that was used to create it for the repair, because connecting manually repairing the fortification with correctly reflagging it is a bit problematic.