I wish there was an easy solution like this for smoking "neighbours". Some sort of detection device that instantly closes my windows automatically and then "explodes" a nasty "stinking bomb" outside (e.g. automatic opening of a container with butyric acid or similar), so it smells worse than their smoke. Eventually their brains would connect smoking with nasty stinking and stop doing it.
But I wouldn't know where to start. :-\