The key is to practice doing both. Try consciously practice microing while having your base buildings on hotkeys to do stuff. Over time you should get better and won't forget to do so. It's just like any other activity though, it takes time getting used to doing something. If you are having a hard time remembering, do something silly like have a post it note on the corner of your monitor saying 'DONT FORGET TO BUILD WHILE MICROING' or something like that. Come up with some way to help you remember and it can't be said enough that it just takes practice to do.
Adding my comment to my answer since it was too long.
Well, I really just focused on answering your example question. Your non example question is pretty subjective and so I would have to say no. How would you decide what is worth in an economic basis? You could argue that killing 1 SCV for the enemy while killing 2 enemies isn't worth it. But guess what, since you didn't spend that 50 minerals on something it can go towards something else. You can't really say that you are down an SCV by doing that. If your question is really 'Should I always try to micro with a base to worry about?' I would have to say yes no matter what anyways.
If I created a graph to say is it worth it, it would be 1 sided to say always do it. If you want a completely economical graph, that's literally impossible. You can't just say you only killed 1 SCV. How long did you stop other SCVs from mining? How long did they have to spend microing to kill your guy. Does not building those SCVs immediately allow a more efficient building upgrade or an expo? There are just way too many variables to make it impossible.
If you want an economic graph, then my answer is No. You can't get a complete one simply because there are pretty much hidden in game values specific to that game in there.
In replay XYZ I microed my Reaper for 10 seconds while neglecting macro. Was it worth it? Should I do it again?
Yes, always do it. You get better, you are likely making your opponent play inefficiently as well.
There is a point where micro hurts your gameplay overall, because you neglect macro. If you forget to build 2 SCVs while microing your Reaper to kill 1 Drone you are actually behind 1 SCV.
Is it somehow possible to calculate this in a replay?
No, Read the above answer in full.