Here is a pic of a Lasermax Uni-Max laser that includes a momentary switch with a rail mounting system. The laser mounts to a Picatinny rail AND has a Picatinny rail on the the bottom of it to mount a light.
I emailed LaserMax about the heat capabilities of the laser and mounting it to the gas block. They replied with:
"While doing some testing on heat capability we put a Red Uni Max in
an oven at 350 degrees for 1.5 hours. They forgot it was in there. They
brought it to me on an oven mitt and within a few minutes as the batteries
cooled to operating temperature it began working again. Not a recommended
test.
It, as all lasers are limited somewhat by the batteries they use.
Exceeding the limit won't destroy the laser (within reason) but it will stop
functioning. Upper limit is 140 degrees."
I tried to find some hard numbers on what the gas block temp would be after sustained firiing but it's hard to find. The data that I did find indicated that after firing 80 rounds as quickly as possible, the gas block on a POF P-415 piston AR-15 temp was 320F. Here is the link to that report:
Gas block/Barrel Temp Report
My Stag 8 has the two set screws right on the bottom of the gas block (the block is pinned too). I'm thinking of placing a thin piece of heavy duty insulating material then use longer screws to attach an aluminum Picatinny rail that would normally attach to a handguard. This would leave only the 2 screws to transfer the heat from the gasblock to the laser mount. Then attach a nice low profile light to the rail on the laser.
Should be a safe setup for any light or laser mounted to a gas block.