To the best of my knowledge, the engine is the same. There may be differences in the ECM, and the '06 and newer will have a different alternator and different radiators. I don't know if this will make putting an 09 engine in an 04 bike more difficult. I strongly suspect Tecdude, Fred, or one of several more will check in before the day is over. Tecdude and Fred definitely have more knowledge than I do.
'08 Pearl White GL1800, ABS, NAV, '97 Bushtec Genesis, Pearl white.