There's no built-in function that can do this. Theoretically you could probably have WeiDU loop over all available items in the game, look up their value and construct the dialog options on the fly from those, but the number of possible combinations would be astronomically high, so I doubt it would be very practical.
Your best bet is probably to make a selection of a few viable items that the party is likely to have, and give the player a choice of giving up a certain item if they have it. Or just simply have an option for the player to say they don't have that much gold at the moment and have the character direct them to the nearest store. Or you could create a special shop that only buys things and doesn't sell any, like Officer Vai in BG1, and let the character open that through dialog.