I can tell a lot of people in this thread must either own their own business, or have a very secure work position.
On harassment: the safety inspector is in CYA mode. If you were standing there puffing on a one-hitter, he'd be remiss if he didn't notice and do something about it. His job would be on the line if management walked by and saw it, and he wasn't aware of it. He's responsible for the safety of the employees, and if a guy is standing there getting high, he'd better put a stop to it or his job is no more. He has a responsibility as safety inspector to verify what it is you're 'smoking'. To him, if it's not a cigarette/cigar/pipe, you need to explain what exactly it is, and why you should be allowed to 'smoke' it in the building, or he's not doing his job.
Does anyone not realize how precarious the job market is? They'd rather fire you quick for making a stink about them questioning what exactly you were doing, and replace you the next day than have a perceived safety issue on their hands.
On suing them: good luck finding a lawyer that would touch that case with a very long pole. As the employee, you have zero damages to claim. The SI hasn't harmed you or your livelihood, and you're not out any money = no damages. Harassment has a relatively narrow definition in the eyes of the law. Asking you for proof of what exactly you're 'smoking' on company property doesn't constitute harassment.
I own a company, and I employ drivers. They are drug tested annually, for their CDL licenses. If I saw one of them vaping, and I was unaware of e-cigarettes, I'd definitely want some verification what exactly he's consuming.
And "look it up online" is full of pitfalls. There are plenty of pro-vaping sites, and plenty of anti-vaping as well. He might stumble on an FDA warning and ban vaping outright.