As for OP's question about the legality of booby traps intended to cause harm in Canada, the answer is no.
Federal laws of Canada
laws-lois.justice.gc.ca
The law is pretty clear:
- 5 years imprisonment just for setting the trap
- 10 years imprisonment if the trap does cause harm
- life in jail if the trap causes death
You may believe your booby-trap is harmless if all it does is cause a loud noise or emit a foul odor, but if the person panics as a result, has a heart attack, or trips and falls and gets injured or dies, a moderately competent lawyer will find it quite easy to have your nuts in a sling.
Even in US States where there are Castle Doctrine laws on the books, booby-traps are still considered illegal due to the potential harm it causes to innocent bystanders like helpful neighbours moving your package, kids or pets.