After an egine replacement where to start is a good one especially since it works sometimes and not others.

1. Get a scan with VCDS
2. If its intermittent I would be looking for a connector not properly seated or damaged wire.
3. was the new engine good?? since its a BLX burn it and put another engine in I am convinced VW searched the globe for all the odd ball parts and fitted them to that engine and made sure they destroyed all the left over bits - Ive been fighting one for some time now.

if you cant easily get your hands on VCDS grab any scan tool that can graph stuff and have a look firstly at engine RPM while cranking.

Check the fuses (in the fuse box in the engine bay a dodgey fuse just cant think of the number of the top of my head will let you crank but no start - ill look it up tomorrow.

But to start with id doubble check all the connectors to the engine. Good luck