302 Swirl port heads vs 340 X heads

will 302 heads work on a 340 with 11.5 pop ups cam is a solid 528 with 248 duration

Most likely, no! 302's are closed chamber and the dome or squish/flat part of the piston will hit the head.

As for the cam, the right way to do it is to check piston-to-valve clearance with everything in place. Too many variables to "guess".