Hi, if I understand your question correctly, your main challenge is how to make sure that the money and email are corresponding to each other. In other words:
Trigger: Order status change
Events after the trigger happen: 1. Generate Invoice for yourself and pay; 2. Send email order to the supplier to inform them the customer address and items.
Your script can already help you to do the second event, while for the first event, you can consider using PayPal Invoicing API integration.
Changes you can make:
1. Use your order status update as the trigger for your script (instead of running the script on a daily basis).
2. Integrate your script with the PayPal API to generate invoice/invoices to yourself.
3. Use the PayPal response after the payment is done as the trigger to send out emails to the supplier as your script already did.
... View more