sounds like your crankshaft position sensor. I've been having that problem with my zj and I'm replacing mine this weekend. Hope it fixes my stalling as well.
1995 ZJ Laredo 4.0 - 5 Speed swap and 4x4 conversion, JKS KOR conversion and durometer bushings, Bilstein 5100s, fixed LCAs
DD - Stock 99 WJ 4.7 QD with flo 40