The ones I've installed over the years had a great deal of leeway as to positioning. The magnet and the sensor did not have to be in relative close proximity. Put an ohmetter on the sensor and play around with them to see what your options are. As to trimming the plastic I don't see any problem with that. I believe the sensor itself is a glass encapsulated reed relay. Trim the plastic and when you get to the glass housing stop or change the angle of your shaving. As long as the reed relay can't fall out of the housing whatever you do should be ok, although you might want to touch it up with acrylic paint when you're done so it looks better. If the housing turns out to be hollow instead of solid then you may have to secure the reed relay with some kind of cement when you're done. Don't be afraid to try this. The glass housing used in reed relays is quite tough.