Sorry for the delay. Not at all! Happy to 'do something'!
I tried replacing the close function with your alteration: But there is no resolution. No change.
I tried removing the related script (<script>) altogether and interestingly, the page still wouldn't display the toolset shortcodes unless I removed several instances of the call to the script in html. Sometimes it worked with 3 sometimes 5... In fact, I never managed to repeat a failure. So I could never conclude on what is exactly wrong with this html even when the script was not active. I removed all the content, CSS classes and tested repeatedly with all kinds of combinations. Never the same result..
Eventually I moved the site across to previous PHP version 5.6.37 and now everything works perfectly.
So what we do know for certain is that:
1. The Toolset [conditional] shortcode with PHP version 7.0.31 has an issue with something in my html on this page which is unique on this website in that it is the only page to call javascript inside a [conditional] shortcode.
2. Even if the javascript is not active there is still a problem.
3. One or 2 html instances always works and that any more than 2 sometimes works and sometimes doesn't.
4. My CSS (folly-popoverlay, folly-popclose, folly-popcontent and folly-popcontainer) is not the problem.
Thanks for all your support Nigel. As I mentioned previously: Eventually I moved the site across to previous PHP version 5.6.37 and now everything works perfectly. I still don't know what the problem is.. A mystery indeed.