I would use the well known formula of
$$ U = \int \frac{T^2 }{2 G J} + \frac{F^2 }{2 A G}\;{\rm d}l $$
where $T$ is the torque on the coils, $F$ is the axial force, $A$ is cross section area, $G$ is the modulus of rigidity and $J$ is the polar moment of area. The axial length $l$ is only that if the active coils that counts.
If the applied force $F$ is a distance $a$ from the coil center, then the internal torque in the coils is
$$ T = F a + F \frac{D}{2} \sin\theta $$
where $D$ is the spring diameter and $\theta$ the location along the coil, starting with $\theta=0$. If the active coils are $N$ then the total angle along the helix is $\Theta = N 2 \pi$ and the length increment is ${\rm d} l = \frac{l}{2\pi N} {\rm d}\theta$. Also for a round wire $A=\pi\frac{d^2}{4}$ and $J=\pi\frac{d^4}{64}$, with $d$ the wire diameter.
The total elastic energy is
$$ U = \frac{4 F^2 l ( D^2+8 a^2)}{\pi G d^4} + \frac{2 F^2 l}{\pi G d^2} $$
for integer number of coils only, such that $\cos(2\pi N)=1$.
To get the deflection at the point of force $F$ you calculate $\delta = \frac{\partial U}{\partial F}$.