Arguably this question isn't a good fit for a learners site, but we are where we are. First of all, note...
...showing that this dated/poetic/archaic construction has little relevance to contemporary English.
The exclamation O (more commonly transcribed as Oh today) can have a wide range of meanings. That MW list is only partial - it doesn't even include the very common use as a hesitation device, for example - but the first definition is what applies to OP's example, where it's being used to express surprise.
Effectively therefore, we can equate Oh here to It is surprising - followed by a "that" clause specifying exactly what is surprising. We can thus rephrase the utterance as...
That they should think so is surprising.
...more simply, noting this earlier ELL question explaining that should is optional in such contexts...
That they think so is surprising.
...or even more simply...
They think so, which is surprising.
In the example in an earlier question on Proper usage of 'to do so', the "referent" of so (what it actually refers to) is explicitly specified in the utterance. In OP's example here, it's not - so we can't even say for certain whether it means that they think in a certain way, or that they believe a certain thing to be true. Probably the latter, but in practice the precise "thing believed" would be clear in context.
The only aspect of this construction relevant to current English concerns potential distinctions between...
Q: "Would you say this is a good answer?"
A1: "I think so."
A2: "I should think so."
As mentioned above, "should" is effectively optional here. As so often happens in such situations, native speakers naturally look for some reason why the speaker chose to add an apparently unnecessary word (particularly in this case, since #A is an extremely common thing to say).
It would be misleading to suggest there's any specific meaning to should in my final example there. The most credible "literal" sense would be "I ought to think that [but for some reason I don't]", but in practice that's an unlikely thing to want to say. Usually it's either a way of adding hesitancy (I might think that if I were to think about it at all), or emphasis (often with think stressed, and an exclamation mark after so, giving the sense of "I very definitely do think that!").