I'm not sure I understand what you are trying to do. Do you want to (1) limit the units that are teleported by the spell (i.e. the spell does not teleport knights, for example, but does for all other unit types), (2) limit the destination to which the teleport can be targeted (like to allow it to only go to a certain building type), or (3) to completely negate the teleport command and not allow it to proceed when cast in certain circumstances?
I'm not sure if all of the above can be done or not, but will think more about it if you can clarify your intent.
Thanks.
Eric