You've already solved the problem, but just for posterity, the correct way is this:
call format[{TYGAMMOBOX%1 = _ammobox},TYGBOXCOUNT]
No extra quotes #EDIT as Triggerhappy pointed out.
Remember, the call command executes the contents of its string as though you had written that down, in your script, yourself. Sometimes it helps to hint out the string, read it in game and think to yourself 'If I wrote that exact code down in a script, would it work?'