I'm sitting here trying to think if there's a way to basically 'pre pick' dice. This was how I handled it on my (d10) code, where the default +roll assumed you always kept highest, but there was also a /switch to keep lowest. I just discarded the idea anyone would ever want a 'medium' roll (and did have it show dice faces so you could pick manually if you really wanted), but obviously that system was easier overall. This would be a lot more complicated in 5E.
Theoretically, you could set up your roll to take the TN as an input. This would mean you'd take successes over opportunities first, up to that number, but then you might need another /switch to specify what you'd prioritize after that (as, for instance, on attacks, extra successes = more damage, while opportnities can be used to trigger crits, so both have value). I imagine the code could be smart and prioritize opportunities if you didn't have enough possible successes to beat the TN, since the game does provide a lot of things that can be triggered even on failed rolls.
Then you'd need another switch/input that specified a ceiling to how much Strife (the negative symbol only appearing paired with good symbols) you were willing to accept on a roll. But that starts getting into some crazy forking logic. Are you willing to take extra Strife to succeed, but not for Opportunity? Or are you willing to fail to avoid it?
With so much decisionmaking, I don't know how plausible it is to try and make an automated solution. Nevermind that there are explosive results among the possible faces, which trigger further rolls etc.