Or... a much needed culture change requiring no scripting.
PC Merchants to make the effort to go in town in the market place to sell their wares, or to the Drain to sell to outcasts.
Other PCs to hold non-mercantile discussions away from merchants, therefore avoiding this minor annoyance most of the time.
I get it that we'd prefer to avoid the spam, but it's really just lasting a few seconds when it occurs. Please understand as well that what you ask for is not so easily implemented or scripted (provided it could be done at all without performance issues). It takes time, it takes skills. To be frank, only a few of the devs have the skills to create such script and those that can already have a mountain of more important items to address from performance issues to bugs to new content. All with very limited time to do so.
Now, we certainly take note of the request, it is a most valid one and we will add it to the wishlist, but we have a lot to tackle before ever coming to that one.