...I'm wondering if a little more pressure would have been better for the beer gun...
Yep - if there is foam in the line, it means CO2 is coming out of solution. 2 PSI is pretty low, so slowly increase the pressure until the beer flows through without foaming.
Steve has a point - cold helps. If you chill the beer down while its on CO2, make sure you account for it in your carb pressure setting.