I ran into this same issue. I never was able to find an answer, and I'm unsure if there even is. I do, however, have some advice to prevent you from being the most generous item shop owner ever.
Know What's in your Store
If you're being offered an item that you are decidedly not stocking, or if the item in question is sparkling with the "SHOWCASE ITEM" it is relatively easy to determine whether they want to buy or sell.
When in Doubt, just go for 100%
If you want to be extra safe and hedge your bets, just go for the flat 100% price. Your customers will be happy, and though you might lose some profit on the transaction, compare the folly of selling an expensive item for 35%, or paying over 117% for an item of theirs.
When you reach a situation like this, if you have to guess, you've got a 50/50 % chance to lose money, or simply oversee another sale (like normal). If you don't want a potentially huge loss, simply stick to the median, and you create an option 3, and when considering "50% lose profit, 50% make normal profit" or 100% make some profit, it's easy to see why the third option is the most appealing.