It's not that complex to do...
- Verify deposits and add them to internal transaction table
- Send all deposits to main wallet
- Dump all internal transactions into the table
- Select all transactions of user to get account balance
- Authorize withdrawals <= account balance from main wallet
IMHO this is easier and faster than using bitcoin transactions and it puts less clutter into the blockchain. You may want to consider a service like
coinbin for integration.
Generally bitcoin shouldn't be used to outsource internal accounting, you wouldn't use Paypal for that either. Not because of the fees and complexity of Paypal IPNs, but because it's the wrong approach altogether.