That's a better example, and the exclusion of mandarin makes it clearer you're being abstract.
Anyway, the algorithm I'm suggesting has three steps whenever there is a mandarin in deck:
-Play out the turn using default decision making (and the current mandarin logic) , with the assumption of a deck full of curses, (or a deck with the cards known to be in it ordered in ascending value top to bottom, whichever.). This might mean it blows up a copper that a moneylender could have used, whatever, the only thing I expect this to do is improve mandarin behavior.
-Check whether you gained a green card. If you did, then stick to default decision making and keep going.
-If you didn't gain a green card and there's a valid green card on the buy priority list, restart the turn and play the turn with a "Hoarding" strategy, and topdeck the most valuable card you can instead of the least valuable card you can. (though topdecking unplayable actions still reigns supreme. Mandarin has lots of big money synergies though..)
This makes the bot go for province-silver pairs of turns instead of Gold-Festival pairs of turns like it does now. The variable for the hoarding strategy itself is also useful for tweaking Mandarin's buy logic.
There's several ways you can implement the hypothetical turn, but overall to check how much you expect to make in the turn all you have to do is use the decision making power it already has, so it shouldn't be too hard.
It might be intimidating because it sounds like a decision tree, and it is, but it will only have two branches, green or not green. If it seemed necessary to have a branch for greening, and a branch for, failing that, getting an attack, and a branch for, failing that, getting a village variant, then you would have runtime issues but this is just a one time doubling of effort whenever topdecking gets involved.