A question....did the OP want to sprayfoam the attic floor to get better airsealing, under the existing insulation, and then up the insulation to R-50 as needed (and keep the attic vented) OR to sprayfoam the roofline sealing the attic?
The former, not the latter.
The furnace and air handler are in the basement. The duct work servicing the 2nd floor bedrooms runs through the attic