Good thing is that you don't even need a script to achieve this. Just adding a few simply and self explaining commands to the init line of the box will do the job:
clearWeaponCargo this; clearMagazineCargo this; this addMagazineCargo ["5Rnd_762x51_M24",10]; this addWeaponCargo ["M40A3",1]; this addMagazineCargo ["10Rnd_127x99_m107",10]; this addWeaponCargo ["M107",1];
e.g. this addMagazineCargo ["5Rnd_762x51_M24",10] will add 10 magazines for the M24/M40 to the box.
Bad thing is that I had to read your post 3 times to actually get an idea what you want at all. And not because my English sucks but because of your failure to use punctuation at all. Maybe that's the reason why you haven't received an answer for that simple question in 3 days.