Any form of booby trap such as contemplated by the OP is legally highly problematic.
Let's look at some basic legal principles:
- In general, one person intentionally touching another in a harmful or offensive way without the consent of the person touched is called "battery." Committing a battery exposes one to at least civil liability, and often criminal liability as well.
- The most obvious type of battery would be one person intentionally hitting another -- a direct, physical touch that is certainly offensive, and probably also harmful.
- But under the law, intentionally "touching" someone with a noxious or irritating gas, such as spraying someone with pepper spray, would also be a battery.
- And you wouldn't have to be there. If you set up a remote device to spray someone with pepper spray, that would also in the law be considered a battery.
- So the OP's booby trap, if tripped by someone, causes the OP to have committed a battery on the person who tripped the booby trap. That is prima facie at least a tort (civil liability) and could be a crime.
- Of course someone who uses force in self defense also commits a battery. But justification is a defense to both tort (civil) liability and criminal liability.
- But it will be difficult to effectively claim justification in connection with the use of a booby trap. A booby trap is indiscriminate. The actor, you, isn't present to make a judgment about whether or not the use of force (which includes less than lethal force) is warranted in the particular situation. Also, you aren't there to be physically threatened.
The bottom line is that at the very least a booby trap creates a significant risk of legal liability to the person who sets it up.
mister_murphy had the right idea. If the OP really wants to do something like this, he needs to consult a lawyer.
Kendahl also seem to be on the right track; opt for a surveillance set up.