Well, for deleting, that event sequence looks pretty straightforward:
1. When you see DELETE_ITEM_CONFIRM, store the name in a temporary variable.
2. When you see ITEM_LOCK_CHANGED, get info about the item in the indicated bag/slot. If the name matches what you saw in #1, you now have the item ID, full item link, or whatever other info you want to keep about the item being deleted.
You could probably add a #3 where you verify that the item was successfully deleted when you see ITEM_UNLOCKED or BAG_UPDATE, but it's probably not necessary.
For selling items, you could hook UseContainerItem; something like:
Code:
hooksecurefunc("UseContainerItem", function(bag, slot)
-- if the merchant frame is shown, and not to the buyback panel,
-- then you are selling the indicated item
end)
and then proceed with watching bag events to see when the item successfully leaves your bags.