I have had to make a system for managing the "net deposits" (and resulting "balance due") on salesorders, which needed to update immediately.
I made some functions that searched all deposits on the salesorder, and then all refunds on those deposits.
I put a user event on the salesorder, customer deposit, customer refund, and journal that resolve the "parent" salesorder(s), then used those functions to calculate the balance due.
Basically I had to exhaustively put events on all records that could change the value I was interested in.