and the box is so the spark from the switch happens in the box and cannot ignite the fumes).
Don't count on that! Unless your box is rated for a Class 1 Division 1 explosion proof environment it won't prevent an arc producing device from igniting a flamable gas. A better solution is to use a switch with sealed contacts but even if that is not intrinsically safe you have the potential for an explosion on your hands.