Can I put foam board on top of the RoofingFoil™ before the metal?

No, the RoofingFoil™ must face an air gap/space in order to work properly. If the air gap is not there, the product will not work. More info here: Why is an air space required?