Man, something that random is going to be a b@st@rd to debug. I know this is a mantra, but there's a lot of truth to it: Bad grounds. Hunt them down and make sure they're all sound. Bad connectors - but you had the engine out and back in, so you've cycled a lot of them and they should be making good contact. You have a new alternator, so your power should be solid. Maybe a flaky ECU? Is the misbehaviour isolated to the engine, or are there any other peripheral symptoms?