If i want a medic to let's say heal 10 HP of a 100 hp marine, how should i set the medic energy, and the unit build rate?
None.
I personally don't know an exact answer for you, but I think trial and error could answer this question. Give a medic 10 Energy, throw it next to the marine with 100hp and see how many DC's it takes to heal 10HP then remove the medic...
None.
Build rate doesn't effect medic healing.
Medics heal 2 HP every time they cast healing.
None.

We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch
I estimate you need 9 energy to heal 20 hitpoints.
This is because of the energy cost (1 energy => 2 hp) plus regeneration.
Can't give you an estimation for the duration. You need to test that.
A test! I demand a test!
But seriously, these things come on a need to know basis, and you're the only one who needs to know. see how many hyper trigger cycles it takes, make estimates, and fine tune your product from there. You won't learn anything unless you do it yourself. It's not common knowledge right now, but you're more than welcome to make a wiki article on it.
Also, unit build rate has no effect on medic healing.
"Parliamentary inquiry, Mr. Chairman - do we have to call the Gentleman a gentleman if he's not one?"