I once had a problem when I lived in an apartment complex: people would sit on the bike, try to roll it away, etc. Installing a high-voltage, low-current transformer (neon sign igniter) with one lead connected to the handlebars and one to the engine would really get their attention when they attempted to sit on it and pretend to ride it. But, after shocking a poor dog who decided to pee on the front wheel one night, I had to remove that...I like dogs...
On a related but possibly apocryphal story that went round years ago...
There was this Harley rider who was pissed off with folk sitting on, fiddling with, stealing etc his bike
He threaded a hole into one of the of corners of one of his split fuel tanks, this hole was a plug thread, he then put a spark plug in the hole where it lived happily in a fog of petrol fumes
whenever he got off the bike he'd take one lkyg lead off the engine and attach it to the tank plug
Sure enough someone comes along , kicks the engine over and disappears in a ball of flame
The story goes the thief was killed and the owner was charged with murder and setting a mantrap
Or so the story goes....