The budget’s a bit low for this kind of thing basically. Modifying what gets served to crawlers can be tricker than it seems. Various issues can arise.
Personally, I’m a little skeptical as to the wisdom of doing this in the first place, but I’m sure you have your reasons.
I think Jay means the discourse client API. You could use that via a theme component to tell when Discourse is fully rendered.
You seem like you’re somewhat familiar with software development. I made a little introductory course on discourse theme development last year which includes a discussion of how to use the API in a theme. It’s free and open source. You can read through it starting here:
You’ll probably need to use a frontend event that’s triggered when the page is rendered. There are some examples of that once you get to the first javascript unit in the course