Read up on OBDII and the CA emissions regs.
You CAN swap in a later model engine, BUT you must retain ALL the equipment.
EVAP, downstream O2 sensors, etc. The biggies will be wiring, fuel tank and evap, and getting all the gauges to work right, since a Hemi is all CAN BUS driven. Don't forget the throttle by wire as you get toward the home stretch!