Opportunity Cost is the cost associated with not doing B while doing A.
The total cost is the difference between the profits you would get by doing B and the cost of performing A.
What type of cost ?
Money, time, enjoyment, happiness, ... there are a lot of ways in which you can calculate the opportunity cost of some activity.
Money and time are the easiest ones to quantify and calculate. But you shouldn't ignore the other related aspects.
If the an activity gets repeated enough, you also need to take into account the compounding effect it may have.
Let's take a quick example of a 4 hour data entry task.
You may be fine manually entering data into your system for 4 hours every month, even though it takes a full half-day to perform.
However, while doing it, you can't do more important / cash producing activities. The cost isn't only the time spent performing the task, but also the lack of income resulting from those other activities.
No, let say that this same task gets spread over the full month. That becomes a 10-15 minutes daily task. It doesn't seem to be a big deal anymore in terms of time commitment. Surely, it can squeeze in... well, not so fast...
Besides that time cost, and the lack of income coming from it. You're introducing a lot more context switching, side activities to get started / finish, reluctance to perform the task (especially if it is an annoying one), ... And that compounds, on day 45, you're having the frustrations annoyances and cons of the 44 days before. Things aren't new, they become automatic and repetitive, there is an increased risk of error, ...
1*20 minutes is different from 20*1 minute
The cost of an activity is more than just the activity itself. Some research shows it can take an average of 23 minutes to set yourself back into some task when getting interrupted. Switching activity frequently isn't helping productivity.
To start automating based on the opportunity cost, you should look at which ones cost you more, based on what you want to optimize. If you want more money, you'll make a different choice than if you want more fulfilling activities. None is a bad choice, know what you are looking to improve.
So, decide what costs you more, what you would be doing instead if you had more free time and work towards getting those out of your way.
By the way, if something costs you less to automate than perform, why are you still doing it? Use the next time to automate instead. You could have both at the end : the automation and the result.