IANA MD:
As was mentioned above, it’s an opiate, i.e., it’s chemically related to heroin. It’s addictive (which doesn’t mean you will become addicted, just that you could be). Opiates are very good analgesics (pain killers). They also induce euphoria (and constipation, but that’s beyond the scope of this OP).
Nobody’s managed to make pharmaceutical progress on separating the analgesic properties of this class of drugs from its euphoria-inducing effects.
Our brains have opiate receptors which respond to opium and its derivatives. A number of neurotransmitters are affected, but dopamine’s effects are more easily identified due to the relationship between opiates and dopamine in the brain’s reward/pleasure system.
I am not familiar with the effect described in the OP, though I’m aware that some opiates are used illegally by athletes (for pain suppression? For artificial runner’s high and whatever effects this has on sustained physical activity?). Opiates cut anxiety, which may contribute to the energizing effect the OP describes. I suppose it’s possible that there’s a weak serotonin effect. Pain relief may feel energizing. Or perhaps there’s a subclinical euphoric effect that increases creativity?
In any event, opiate addiction is no fun. Prescribers are generally reluctant to prescribe opiate pain medication because there isn’t a “sign” of pain (so you have to rely on the person’s self report). Not to be a wet blanket, but the more prescription opiate drug abuse that occurs, the harder it will be for people with legitimate pain concerns to get a prescription. (And yes, I know there are some docs who hand the stuff out like candy, but they’re not practicing within the standard of care for their profession.)
“Opium and all opiate derivatives like morphine, heroin, Vicodan, Percocets, and Dilaudid affect opiate receptor sites in the brain by flooding those sites. Endorphins, which our own brain produces in response to exercise (runner’s high) or pleasure also interacts with those sites too, but the opiates are much more intense and longer lasting.”
http://www.colostate.edu/Depts/HHS/APresDrugsTobacco.htm
“Opiate receptors exert effects on synaptic transmission by presynaptically modulating the release of neurotransmitters, including acetylcholine, norepinephrine, dopamine, serotonin, and substance P.”
http://www.pharmcentral.com/narcotics.htm
http://opioids.com/dopamine/dopamine.html