I've been working with this for a while and I find it frustrating slow and unreliable. Especially working with an HTTP listener. Does anyone have better experience/advice?
Otherwise, do the heavy lifting somewhere else and use GAS as a very basic wrapper for your sheet.
One pattern that worked well for us in the past is to use Firebase functions (or Google Cloud Run) and leave the scripts to act as a dumb API to interact with the sheet.