Dude! check out Space Guy's Wrench Events. You can do most of this, only you can't set a distance for the turrets, or a IFF protocol. But you can also do so much more, like doors that decolide to walk through, changing lights (light switch, etc), bricks can through you in a direction (think Halo 3's man cannon, but knock-off), damaging bricks that hurt or kill on contact, and laser tripwires that can set off these actions...
This guy's mod powers most of my greatest creations!