If you are in a region allow to use the P

The title is not very specific I think, but what I want to do is that when a unit enters a specific region it allows you to use the P command to move to another region, how can I do it?

if unit bound to region == true or region name == region
make keybind p in unit setting
move entity to region

In the script run by the keybinding, check if bounds of last ability casting unit overlaps with the specific region.

The first half of this video will show you how to do what you want to do.