If there were some organ, akin to the liver or a gland (I'm blanking on organ functions right now), that produces magical energy to project through the body, its various vessels, and directly out of the body, where would the most efficient location for it be? And where would it be if it were only to affect other organs (like forcibly activating melatonin, melanin, or adrenaline)?
These answers depend greatly on the way the vessels are connected. If it needs to operate at chemical speeds, it might be able to simply hook into the bloodstream and have that do its thing (this is how our adrenals work). If it needs to operate faster, it might choose locations which are connected in more of a neural approach. Perhaps for fun, such an organ might be snaked along the spinal chord.
If Eastern style magic is useful in your world, consider having it very close to the center of gravity of the body. Many Eastern groups believe there is an "energy center" there, such as the Dantian of many Chinese martial arts. There are many such "energy center" concepts such as the Chakra used in many Indian religions and practices.
I'd also consider looking into what it connects to. In yoga, for instance, everything is associated with the breath, so a magic system with elements borrowed from yoga would wish to make the organ related to breath.
And finally, many consider the heart to be an organ with the behaviors you mention. It all goes to show just how much freedom you have to make such attachments, and make them work.
I would consider making the skin the magic gland. (The skin is technically speaking, one large organ). Since the skin is the boundary between the outside world and the inside of your body, it make sense to make the skin the organ, as it would allow the easiest "exposure" to manipulating the environment.
And since the skin wraps around pretty much the entire human body, it would have quick access to any inner sections of the body where we needed to project magic. If we need to directly apply magic to certain organs, the skin area closest to that organ would be able to activate, giving the lowest average magic application time.
You can consider the mitochondrial potential. They are the energy converters. It has its own genome. They co-exist vitally with each cell and concentrations can vary widely, with some organs containing more than others. I'd like to think that magical potential could reside within these mysterious motors.
It's magic—why can't it go anywhere it wants?
The body has a variety of distribution networks already: the nervous system, the circulatory system, the lymphatic system. Depending on how you envision your magic to work, you can place the organ centrally in any of these systems (e.g. heart or lungs for circulatory system, maybe basal ganglia for nervous system, thymus for lymphatic system (it's where immune cells that might attack the body are selected out)). The pineal gland has interesting historical connotations.
But you can also postulate your own additional distribution system for magical power, arranged in whatever way makes sense for your idea of magic. Chinese medicine postulates a system of "meridians" of just this sort. You could pick somewhere where there seem an interesting convergence of meridian lines, for example.
The pineal gland already has mystical connections and has been used for this purpose. You ought to play off that, along with the existing mythology of the "third/inner eye".
The best energy transfer system in the body for Magic would be The peripheral nervous system (PNS), the part of the nervous system that consists of the nerves and ganglia on the outside of the brain and spinal cord. This electrically based system is bi-directional, allowing you to sense magic as well as transmit it, and can allow for Reflex reactions. PNS reflexes can happen without active though, as the impulses don't even have to travel all the way to the brain in order to react.
So the Magic Gland should simply be part of the Spinal Cord.
The endocrine glands affect most parts of the body, and as you can see from this Wikipedia image, they're all at or near the body's center line.
Endocrine glands are glands of the endocrine system that secrete their products, hormones, directly into the blood rather than through a duct.