Try to make something that reads and interpret the current map/position attributes (for example, check outdoors **** in pack folder).
In the past people made no-safezone changing files inside it (I don't remember the exact file now, but try to search about .atr files and see how it works). Btw, I said about no-safezone because its related to map attributes, so you can try to get some idea from it.
Just to say, you can't do it from python. Probably you know but anyway...