The rules of engagement are simple.

If the item has never been spirit bonded and the player has not left the area -- item can be returned to vendor for cost of tomes.

Correct me if I'm wrong; Using an item to glamour another item spiritbonds both items, yes? So, this would prevent players from buying and selling back after glam.

If this is incorrect; simply make it to where any refund is null after closing the vendor window. Glamoring cannot happen with the window open. One gets the "Unable to execute command while occupied." if you try.