In any computational environment(digital,neural,analog or quantum mechanical) is it possible to write or construct a program which can be construed as free will?
No. First consider what we mean by free will.
One sense of free will is that with enough information it is possible to predict every choice the machine, let's call it Mike, makes. There are two major problems predicting what Mike will choose, chaos and quantum physics. If the universe were perfectly deterministic, then we could theoretically build a machine to predict Mike's choices. Chaos theory introduces the problem of initial conditions, that we have to have infinite information to predict Mike's choice. Quantum physics introduces Heisenberg's Uncertainty Principle, that it's not even possible to know everything about Mike's state at any point in time.
From this one might gather that free will is therefore true, but this is incorrect. Just because it is impossible to know the exact state of Mike at any point in time does not mean that there is not an exact state of Mike at any point in time. However you want to see mike, as a quantum system, a chaotic system, or a classical system, his choices are a product of events in that system. To claim free will is to say that somehow Mike is able to transcend that system.
That being said, Mike is a decision making machine, just like us humans. Because at some level the decision making process is opaque to all observers within the system, Mike is like a black box. Because of this fact, what is the practical difference between Mike and a machine that actually has free will?
Claiming free will exists is the same as claiming souls exist, because they are both outside the realm of physics. However, you could claim that Mike does have free will, or a soul, and no one would be able to disprove you. The only way to "build" a machine with true free will would be to do so outside of the boundaries of science.
The closest you could is to use a true quantum mechanical random number generator, and base the program's actions off that. If quantum mechanics is correct in saying the universe is inherently random, the program's actions could not be predicted in advance, and would thus constitute a form of "free will".
Of course, that doesn't mean the program (or machine running the program) has free will any more than a rock has free will, but, since you can't predict its actions, it can at least give the illusion of free will, even though it's running a fixed algorithm.
There are several methods to generate psuedo-random numbers and sites like https://www.random.org/ use atmospheric noise to generate high quality random numbers, but, if you accept that atmospheric noise is predictable (ie, it measures something "large" enough that quantum randomness "averages out"), then your program's actions could still theoretically be predictable.
By using a true quantum random number generator, your machine/program's actions would be unpredictable, even in theory.
NOTE: google suggests there are some sites which offer true quantum-level random numbers and that true quantum-level random number generators (hardware) are available. I did not explore either deeply.
I think the answer is simple based on the wording;
"construct a program which can be construed as free will"
and the answer is yes. Whether or not free will actually exists is irrelevant considering that many people have construed our own existences as having free will. The chess playing computer has free will in the sense that it chooses what moves to make based on input.
Humans, which we'll say have free will for the sake of comparison, are also limited by knowledge/information but make similar decisions.
It is conceivable that as technology grows, and things like google's deep mind improve, we'll have programs that learn information and make decisions based on that information ultimately writing their own programming the way a human defines themselves and builds character from experience. But is it free will, it can be construed as such a thing, but if you break even our decisions down to reactions in our neural pathways and the deterministic behavior of atoms, there may be no other way to declare free will.