If you are often updating your scripts, you need to offer an SDK so that users can import the code through an SRI checked script. It looks like Optimizely has one available: https://github.com/optimizely/javascript-sdk, so there's no reason not to use SRI with it.
I still don't see how this would prevent this type of attack.
An SDK doesn't necessarily mean that scripts are kept up to date as a site's build could've been done months or years ago with the SDK version pinned in npm.
If I were to setup a system today, I would mirror any script from a third-party and pipe it through a LLM to check for malicious code before deploying.
Yeah, essentially none of these larger sites want to manually approve third-party script changes like this (if they did, they'd have self-hosted the script at a minimum (some do! not many)). They'd have just automated adding any new script SHAs, and then it'd be exactly back where it was before.