I've narrowed it down to inconsistent indentation, it looks like I won't be able to name the chips unless I pull a cash-tree bait and switch (cash trees actually produce spawners which spawn cashbased on potency) or leave them without a name, no idea how the venders will act with that. They might really freak, or they might name the type of chip you're about to buy. No idea.
not 100% sure what your trying to do as i am just skipping through the topic, but...
i think you try to make chips that you can get from a vendor (like cigarette automat?) and then are randomly named or something around that...
not sure if its in this ss13 version, but i remember from gibbed #3#4 (?i think they are renamed too by now?) they had "pro puff" cigarettes? that give you a random cigarette when you use it or so...
maybe if you check on that code (if you can) you get ideas for your chips?
as the pro puffs are from a vendor automat like the chips (cigarette box compared to a chip bagbox?), chips are random and cigarettes are random when you pull them out of the box? and cigarettes have effects on the body where chips have "taste" (?) on the body?
but yeah... no real clue what you try to do as i was just skipping through, so can be that that hint to check on code of a item that kind of works similar might be totally wrong here.
still posting this... if it helps a bit then great... if i am totally wrong then just forget it