Simply expanding the if statement used to check if you are in a smoke tile, and possibly an import to allow you to get the environmental protection of your mouth piece, should allow this.
Now, you’re going to need a C++ programmer (java man here) to get it working.