What value should I use for P in the ideal gas equation for an unknown molar quantity?
Strictly speaking, the pressure inside must be certainly higher inside due to the restoring forces generated by the stretching of the plastic bag. It is this force that causes the gases to gush out when punctured or opened.



Bottom line: the assumption of the pressure inside being equal to atmospheric pressure can be considered correct with a considerably large error margin, provided we are talking about a ziploc bag and not the tyre of a tractor.