Instead of searching all records, what about a trigger on the quantity field in Table A. Then you can use $prev to get the previous value and only continue if it decreased.
A) Trigger on Record Update, quantity field change on Table A
B) If a.quantity > a.$prev.quantity
Stop
C) Search Table B matching appropriate Table A record, limit= {{ a.$prev.quantity - a.quantity }}
For Each C
D) Delete record
I think you were on the right track at the beginning, but you didn't have a loop around the Delete record step.
Hope that helps!
------------------------------
Doug Henning
------------------------------