There's multiple levels of software on these phones. There's the OS level, which is probably similar in the whole phone line. although the versions are different (4.1.2 versus 4.2.2), and there's the driver level and hardware-specific code. I think that what you're going to run into is that you're going to have become a driver developer to make S4 hardware devices work on the S3, since the drivers for the S4 will not work right on the S3, the S3 has different drivers for it's own hardware. There is a lot of different hardware around the camera in an S4 and an S3.
I guess what I'm saying is that I'd be very surprised if you could get this to work without a lot of playing around, some coding and rebuilding of the whole OS (including drivers). It may be that the camera hardware has a standard hardware interface at the top level, but that would surprise me. But I like to be surprised *smile*. Even if that were the case, you'd still need an S3 driver for the S4 camera, since the hardware that talks to the camera is different between the S3 and S4 (I'd bet).
When Samsung "brings the S4 features to the S3" that it can (due to the differences in hardware), the driver that Samsung supplies for the S3 camera will be an S3 camera driver, not an S4 camera driver.