While I can't say whether you should paint first or later...... as far as pouring it in, that's what the factory does. However, the factory does not provide for proper drainage, they pour it where it's in direct contact with the floor, not a good thing to do in an aluminum boat.
My suggestion would be to put some type of fairing strips on the floor, made from something that won't break down, such as PVC pipe split longways, then put a thin sheet of closed-cell foam, like 1/2" on top of those strips, then pour your foam.
This will get the foam up off the floor where it can get air underneath, allowing any water to drain from the foam, as well as preventing poultice/crevice corrosion of the aluminum from being in contact with water or waterlogged foam.