The 1200 has hydraulic lifters so there is no common adjustment like you would see on the older models. There is outlined in the Service Manual a procedure for checking the "shims" but I've never heard of anyone actually doing that. Are you sure the rattle you're hearing is the valves? If you go to 4th or 5th under about 2500 rpm and try to accellerate the engine seems to "shudder" a lot as it is way too loaded down at that point and you that sound is a warning to down shift.
The other sound I've heard from one of the 3 GL1200's I've owned is the valves, or tappets, rattleing after the bike is fullly warmed up and been at idle for a minute. But then I hear it when I go up through the gears and then for only a second. That is more common and I've heard that running some ATF or Marvel Mystery oil in the the crank case (1 qt ATF or MMO to 3 Qts of oil) will clean the inside of the engine and possibly the lifters so they stay pumped up with idle oil pressure. If you use this "cocktail" only run it for 50 to 100 miles then change the oil and filter to 4 Qts of oil.
And yes 40 mph in 5th gear is way too low a speed for 5th. Don't shift into 5th until you are above 50 to 55 mph if you want to accellerate hard. Like I said that noise should be a warning that you need to drop down a gear or two. I am pretty sure that the rattle you hear is spark knock or detonation.... Ever heard the term "grenade the engine"?