Glad I could help! And hm yeah I’m not knowledgeable enough to think of what might be causing that issue. But yeah just biting the bullet is really the best course of action most of the time.
It’s very time-consuming though, and I totally feel your pain.
That’s what I started with: disabling plugins one by one, but that didn’t show any issues. I noticed the code was only appearing on Buddypress pages, so then I kept Buddypress active and one-by-one activated, checked, and then deactivated each plugin until the code reappeared.
It takes a super long time, but it’s really the only way to really find issues like this (that I know of).
I also use the Health and Troubleshooting plugin to do this, so the site doesn’t appear any different to anyone non-admins. That means people can keep using the site (I have courses with Learndash, so this is a big one!) while troubleshooting
Update regarding the random jquery: appears to be a plugin conflict from Booster for Woocommerce. I’ve reached out to them and hope they will respond soon