Taking too long receiving a 3rd party request certainly sounds like bad style.
Here’s what appears to be the official timeout guidelines:
PayPal's Instant Payment Notification (IPN) system expects your web server to send an HTTP 200 response when the IPN is sent to your IPN script.
If your server does not respond after a certain amount of time, the IPN system then re-posts the IPN to your script.
The amount of time between each re-post doubles each time: 10 seconds, 20 seconds, 40 seconds, 80 seconds, etc., up to a maximum of 24 hours. The IPN system stops re-posting when PayPal receives a basic HTTP "200 OK" response from your web server or when approximately four days have passed since the initial post.
Note: This functionality applies to both Sandbox and Live accounts.
You could kick off a separate process that runs in the background to take care of all the rest you need to do.
How to do that depends on your environment, see e.g. php execute a background process.
Note that you’ll have to pass all the info to the script that is necessary to do what it needs to do (transaction ID etc.) That info is not automatically passed to a PHP script you start using exec()
or through other means.