What if someone pays me back before I'm done entering in expenses?
For each friendship there is a balance, and each payment is netted out against the balance.
If someone pays back before all expenses are added, they will get "credit" for their payment, and the new expenses added after the payment will change the balance back to whatever they are supposed to be.
Unfortunately, this will probably result in some follow-up payments needing to be made, but in any case the math will still be correct.