The two things to watch out for are the engines were either transversely mounted or inline and later engines this means the mounts and where the turbo and pipe work is sited is different. So stick with the correct mounting orientation, although you could always strip the old engine mounts and pipes and fit these to the new block.
(Post 2008) approx used a CR rather than PD fuel system so you can either fit the old PD injectors/fuel rail or get the ECU upgraded to cope with the CR fuel system.
The blocks and components are pretty much the same with very slight revisions. For example there were 3 versions of the head, all bolt on and work fine and are interchangable, the later ones were stronger. Oil pumps, chains, tensioners and similar bolt on parts are the main differences between these engines.
ECU's are setup to work with the sensors on your engine, crank, fuel pressure, turbo, AFM etc.... and some engines had different sensors on them. If It was me and I hit this problem I would take the sensors from my old engine and fit these in the new one.
Also make sure the injectors are the same, and I don't think any engines of this vintage had DPF's to worry about, at least not the 140's.
I would be very tempted to drop in a 170 engine and get the ecu remapped. This is a little more work but not much more and you'll get a stronger turbo and significantly more power.
Thankfully most of the VAG group engines, mounts and gearboxes are standardised so Frankenbuilds are quite possible.
When the engine is off you may as well do the clutch and cambelt.