The LS2 is the same physical size as the LS1, so from that standpoint, the engine swap should be a bolt-in.
The biggest problems will be wiring harness...some Gen 4 engine accessories (the KSes for example) are in different places and may require additional wiring.
The next problem will be how to adapt the Gen 4 engine controls to a car wired for the Gen 3 controls. The LS2 engine controller is different along with, as c4c5 says, platform communications. Also, in the case of an automatic, there will be additional complexity, because the LS2 controller is engine only and the LS1 controller ran both the engine and the trans.
I suspect, it would be easier to adapt the Gen 3 engine controls to the Gen 4 engine.