I had a very similar problem. It would die when I put it in gear, before the tranny even seemed to catch. It was as soon as I moved the shifter.
My problem turned out to be my cam sensor. It was out of adjustment. The thing is, the car had been running fine until it popped a few times when I had it on a dyno. After that, I had trouble keeping it running.
Try unplugging the cam sensor(when the car is running), and see if it still happens. If the problem goes away, then your cam sensor is either out of adjustment, or is bad.