To go up the hill at 40 mph requires either more rpm (a shift down) or more throttle to maintain the same rpm not shifting, either of which indeed uses more fuel to do the increased work. The work's the same, so either method is likely to require nearly the same fuel and generate the same heat. This affected, of course by pumping losses caused by a more-closed throttle, i.e. economy could be better simply with the larger throttle opening as opposed to the downshift.
In any event, blipping the throttle while stopped in traffic does nothing but put more heat into the engine and engine heat in traffic is not the problem