What is the potential energy stored in a spring when it is neither compressed nor elongated?
Zero
Potential energy is obtained due to the configuration of a body. For a spring, which is neither compressed nor elongated, the potential energy is zero.