This is my understanding of this scam:
This has happened to me before where another player (scammer) has tried to scam me out of a few Idol of the Suns. This is not due to any batching changes, but in how the trade window works when there is no gold in the trade window. When there is no gold in the trade window, there is no confirmation dialog that pops up asking you to confirm the trade. Blizzard should 100% change this so that a confirmation dialog pops up on any trade and there will be much much less people being scammed in this fashion. Also I am not blaming you for this happening as it is hard to notice if you are not looking out for it in the first place.
What the script/weakaura/whatever does is it puts gold in the trade window and when you put an item in your side of the trade window, it instantly removes the gold and hits accept. It depends on you also instantly hitting accept after you put the items in the window expecting the gold to still be there like it was 0.1 seconds ago.
The way to prevent this from happening again in the future (or in the first place if you read this beforehand) is whenever you are trading with someone you do not know, put the items in the trade window, then just wait (at least a few seconds). Make sure they hit accept with the gold in the trade window first before you hit accept. If it is a scammer they will instantly remove the gold and hit “accept trade” right after you put the items in the trade window.
A legitimate buyer will never remove the gold instantly like that the split second you put your items in the window and press accept that fast. You can even try it a few times with them. If it doesn’t work with 0 gold, they will then try again with some gold, but usually a denomination of 10 less than what was agreed upon (Example: they agree to buy item for 840g, try first with removing all 840g and accepting, then try again after a few attempts with putting 840g, then making it 84g). Once they realize you will not accept the trade with the no gold in there they will cancel and leave the group without saying anything.
The safest thing to do when trading your items for someone else’s gold is to put the item(s) in the trade window and just WAIT. Make sure they hit accept with the correct amount of gold in the trade before you accept. If you do not ever accept the trade right after putting the items in the trade window, they cannot take the items from you for no gold if you are paying attention to and have the knowledge of this scam.
This is not so much something to look out for when you are buying an item because whenever there is any amount of gold in the trade window, a confirmation dialog will pop up every time. Blizzard knows about this scam by now and all they have to do is make a confirmation dialog pop up on every trade, not just ones that have gold involved when the accept button is pressed.
Hope this helps you and others to better understand what happened and how to avoid it in the future. I would not go ahead with acquiring this script/weakaura and doing it for yourself because you too will just end up getting the items removed and get that account banned only losing time and money for yourself and losing time and items for another player to get scammed like you did. It is definitely not allowed, but it does target a vulnerability in the trade window that Blizzard really really should have fixed by now.