An engine swap has it's challenges, as does replacing the timing components, and whilst doing the latter whilst the engine is out makes that task easier, it makes the first one more of a challenge, you don't know if the problem is caused by the first task or the second.
Based on my understanding of the error code, and a basic familiarity with Suzuki electronics, I'm guessing the problem is more related to the swap than the timing component replacement - I can't say with any certainty that the timing is correct, but, the electronics don't really sense that - the error is suggesting that the ECU is not seeing the output from the cam position sensor.
Get a scope and hang it on the cam position sensor and see if it has output and then repeat at the ECU end of the harness.
Edit...
Take a look at your FSM, it will outline a series of possible causes for the P0340 and a series of steps to isolate the problem - at least mine does.