My Guild Companion articles on magic and society will be addressing this issues soon, but here are a few of my favorite countermeasures:
For invisible intruders: bead curtains come into fashion. Seriously, you can't walk through a bead curtain invisibly without giving yourself away.
For teleporting assassins: same as real-world dictators with lots of powerful enemies, keep changing where you sleep.
High level leaders come into their own here, especially those that are hard to kill: Monks and Healers with their subconscious healing.
Guards stationed in the royal bedchamber (with screening to weed out shape-changers/illusionists). Better a little loss of privacy than loss of life.
A lover who is a high level member of a Profession with good skills for fighting assassins.
Kill your enemies first.
For theft, there are a number of spells that can be triggers by circumstances. Such as "someone not a store employ or owner enters when the store is closed". But I am afraid for the most part, one must rely on the threat of punishment to discourage theft. There are many spells to help hunt down and hurt those who break the law. The thief might also find that you have a security guard he never expected because he always comes to work invisible.
There's lots of countermeasures possible to various threats. Then there are countermeasures for the countermeasures. And so on.
You can Long Door all you want, you have to go somewhere and it won't take you far. If you didn't bother to get out of sight, you didn't even move out of crossbow range. Thunk. Thunk. Thunk. Thunk. Goodbye.
If you are running a feudal or semi-feudal society, then guards can search door to door, so teleporting into a private building won't protect you. (Although you can then try to hide.) Even leaving town is less effective than in the historical world, because magic can help your crimes follow you long distances. Constantly having to establish new identities can get to be inconvenient.