What exactly are you trying to do? It's clear that you've created a new entity and that you're attempting to have it do something after a player (or bot) touches it, but it's not exactly clear what you want. Without more detail as to exactly what you're trying to accomplish, it's hard to provide very detailed help.
However, I'll try to provide what help I can based on what you've given so far. It seems that your main issue is that when usebox is called, you don't have a reference to the box you wish to manipulate handy. A simple way to fix this is to have mystery_buy set a field on other (the player) to point to itself. (Either add one or find one not used by players and bots.) Then in usebox, you can use self.whatever to get at the box.
However, there may a better way to do what you're trying to do, depending on how exactly you want the mystery box to function. So, once again, more details would be useful to provide better advice.