Well, I know a much simpler code that could be created. There can be a code that modifies how much a visitor spent in your town (there should be an address because the game keeps track of it i think)
But I don't have a trainer toolkit so I can't make that code :(