We build custom/luxury homes in central Maryland and we have used more and more foam over recent years. I know were are talking about a shop/barn, but the thermal principles are pretty much the same.
Our current recommendation for best performance vs cost investment vs future access for plumbing/wiring is to use R-30 batts under a framed cold floor, R21 batts in the (2x6) exterior walls and R49 closed-cell foam in the roof.
Going to foam in walls increases thermal performance, but voids like windows and doors can offset a lot of the insulation gain. Going back in later to retro-fit any wiring, etc. is a major pain and costly due to drywall trenching and repairs. Sometimes conduit can be run (such as to provide for a future finish in an attic/bonus room) prior to foam, but not often.
The closed-cell foam is more expensive than open-cell, but doesn't absorb water (potential roof leak), forms a very effective vapor barrier, isolates the roof sheathing from the warm/moist air (no condensation) and doesn't out-gas.
Local cost approximations (actual location and construction variables affect this):
Roof:
R-49 open cell foam is $4.60 per square foot and has to be 13" thick.
R-49 closed cell foam is $9.00 per square foot and is 7" thick.
R-49 kraft-faced batts against the roof are $2.45 per square foot, but also require:
Baffles at $0.28 per square foot (8 sf baffle at $2.20),
and may also need:
FSK (fire barrier paper) at $0.70 per square foot is required if drywall not directly applied.
A potential issue with batts and open-cell foam can be the depth of the roof's structural members (truss top chords/rafters) and available space vs the thickness of the insulation.
Walls:
R-21 closed cell foam is $3.90 per square foot.
R-21 batts are $1.25 per square foot (will also require FSK paper at $0.70 if not directly covered by drywall/plywood).
Some of the houses we've built use all foam insulation in conjunction with geothermal HVAC systems and are incredibly energy-efficient, but will require years to break even on the initial investments.
Another aspect of foam is that it will make a house 'too tight' and will require "make-up air" for bath fans, kitchen exhaust fans, etc. so a fresh air feed is necessary. Depending on volume and type, a fresh air feed can cost another few thousand bucks.