Quoted:so where is the most affordable place to buy foam? This is just for organization and storage in my garage, so the foam doesn't need to be the highest quality, just something affordable should work.
View Quote
http://www.caseclub.com/order-foam.htm - Order foam in specific dimensions
https://customdesign.mycasebuilder.com - Order foam, order cases, design your case, have it cut or cut yourself.
https://www.google.com/#q=site%3Aar15.com+cutting+foam Google search results for AR15.com and cutting foam
https://www.ar15.com/archive/topic.html?b=3&f=4&t=292695 - Probably one of the best discussions on the matter.
Things I've found out from cutting my own and doing a few for other people.
Use the densest foam you can find.
Consider closed cell foam (GI ground mattress works well) as a final defense between the foam and the case
Cut a slit and use a strip of Kydex to keep the muzzle from digging into the foam
Consider (twice!) what orientation you want, serial number visible? If the case falls, do you want the scope on the bottom or the top? Magazines bare or in carriers? Space for extras?
Consider making some cuts 'jigsaw puzzle' style so that you can change out scope or light options, forearms with or without accessories, etc.