This sounds like the Exact same symptoms I am having on my Z3 with a S52 conversion in it. Same kind of starting issues. I replaced the Crank shaft position sensor. Now I am replacing the cam Shaft Position sensor after reading this thread. I pray it works.
That's gotta be the issue.
96' Z3 M Conversion. 98' M3 S52 tranplanted into the little beast