I have had the spray foam applied on a few different jobs, for myself and for customers. Cost is pretty much a dollar a board foot. So a buck an inch times your square footage. For your case I think you will be good with the two inch rigid foam. And $20 a sheet is good for 2", here it's going for $32
Do you have building codes where you are? Here in the City Code Enforcement would want the foam covered with a fireproof coating. Either drywall or a special spray on product that costs another dollar a sq ft.