The unbiased, normalized autocorrelation function (ACF) $r_{xx}[\tau]$ directly computes the desired "periodicity coefficient". It is defined as
$$
r_{xx}[\tau] = \frac{N}{\left\|x\right\|_2^2\cdot(N-\tau)}\sum_{i=0}^{N-\tau-1}x[i]x[i+\tau]\quad\text{ for }0\leq \tau \leq (N-1),
$$
with $\left\|x\right\|_2^2$ the squared (Frobenius) norm (e.g., the energy) and $N$ the length of $x$.
You just have to determine the height of the first maximum with a time lag $\tau$ different from zero, $\tau_\text{max} = \text{arg max}\left\{r_{xx}[\tau]\right\}\text{ for }\tau \neq 0$.
- If $r_{xx}[\tau_\text{max}]=1$ the signal is periodic with period $\tau_\text{max}$,
- If $r_{xx}[\tau_\text{max}]=-1$ the signal is periodic with period $\tau_\text{max}$ with the phase-inverted version of itself,
- If $r_{xx}[\tau_\text{max}]=0$ the signal is not periodic.
Values $-1 \leq r_{xx}[\tau_\text{max}] \leq 1$ are a measure for to which degree the signal is periodic.
The periodicity measure you asked for, with a range of $0\ldots 1$, can, e.g., be implemented by discarding all values $r_{xx}[\tau_\text{max}] < 0$, resulting in:
$$
p = \text{max}\left\{0, r_{xx}[\tau_\text{max}]\right\}.
$$