Use Pathing to block unit entering/ unwanted areas, such as doodads or map border.

Options:
Painted Pathing
Add / remove pathing baed on individual cells.
- No Pathing: no unit can pass (red)
- Ground only: air unit can't pass (green)
- No Building: (yellow)
Dynamic Pathing Fill
Place points which block pathing for all terrain on the same cliff level as the point. For example, don't let unit enter water/lava.
No Fly Zone
Place points which block flying units within range of the point.