Some places sell screw/nut assortments, but they are mainly of the common hardware store sizes, very useful for general work but not much help on most guns. Harbor Freight used to have such an assortment; I got one years ago and it has saved me countless trips to the hardware store, but only rarely has one of those screws worked in a gun.
For guns, you pretty much have to know what you need and order specific screws or at least specific sizes. And even if you know a thread size (6x48 for example), you would still have to know the length and type of head (pan head, fillister, oval, round) and type of drive slot (Phillips, slot head, Torx, etc.).
Sometimes, a screw head can be reshaped in a lathe or a drill press to fit a specific need, or even a hole can be drilled out and re-tapped for a common size screw. But that is not always possible and is not recommended for collector category guns.
Jim