You want to estimate $x \to +\infty$:
$$\sum_{\substack{\text{primes }p_n\leq x\\\text{such that }p_{n+1}+2\text{ is prime}}}(p_{n+1}-p_n)^2$$
Let $n\in 2\mathbb{N}$, and consider the 3 tuple $\mathcal{H}_3 = (0,n,n+2)$.
The 3-tuple $(0,n,n+2)$ is admissible iff $n = 1 \pmod 3$ or $n = 0 \pmod 3$.
Let $\pi_{\mathcal{H}_3}(x) = \#\{(p,p+n,p+n+2) \in \mathbb{P}^3 \, | \, p+n+2 \leq x\}$
The Hardy-Littlewood conjecture states that :
$$\pi_{\mathcal{H}_3}(x) \sim \left(\displaystyle\prod_{\text{p prime}}\frac{1-\frac{w(\mathcal{H}_3, p)}{p}}{(1-\frac1p)^{3}}\right) \, \dfrac{x}{\log(x)^3}$$
Where $w(\mathcal{H}_3, p)$ is the number of distinct residues $\pmod p$ in $\mathcal{H}_3$.
We have $w(\mathcal{H}_3, 2) = 1$ and $w(\mathcal{H}_3, 3)=2$ and $p \geq 5 \implies w(\mathcal{H}_3, p)=3$
Then:
$$\pi_{\mathcal{H}_3}(x) \sim \dfrac{9}{2} \left(\displaystyle\prod_{\substack{5 \leq p \\ \text{p prime}}}\frac{1-\frac{3}{p}}{(1-\frac1p)^{3}}\right) \, \dfrac{x}{\log(x)^3}$$
See that The k-tuple conjecture holds also for consecutive primes.
Then if $\pi_{\mathcal{H}_3}(x,n)=\#\{(p_i,p_{i+1},p_{i+2}) \, | \, p_{i+2}-p_{i+1}=2, p_{i+1}-p_i=n,p_{i+2}\leq x\}$ we have:
$$\pi_{\mathcal{H}_3}(x, n) \sim \dfrac{9}{2} \left(\displaystyle\prod_{\substack{5 \leq p \\ \text{p prime}}}\frac{1-\frac{3}{p}}{(1-\frac1p)^{3}}\right) \, \dfrac{x}{\log(x)^3}$$
We have $n = 0 \bmod 2$ and $\big( n = 0 \bmod 3 \text{ or } n = 1 \bmod 3 \big)$, then:
$$n = 0 \bmod 6 \text{ or } n = 4 \bmod 6 \quad , n \neq 0$$
Suppose that $n \leq N(x)$.
($N(x)$ is the maximum gap that $p_{i+2}-p_{i+1}=2, p_{i+1}-p_i=n$ hold in the interval $[1,x]$)
Then we have:
$$\displaystyle\sum_{\substack{\text{primes }p_k\leq x\\\text{such that }p_{k+1}+2\text{ is prime}}}(p_{k+1}-p_k)^2 = \displaystyle\sum_{\substack{n \leq N(x) \\ n = 6k, k \in \mathbb{N}^*}}n^2 \cdot \pi_{\mathcal{H}_3}(x, n) + \displaystyle\sum_{\substack{n \leq N(x) \\ n = 6k+4, k \in \mathbb{N}}}n^2 \cdot \pi_{\mathcal{H}_3}(x, n)$$
Using Granville's conjecture $N(x) \leq (\alpha+o(1))\log(x)^2$ with $\alpha \geq 2 e^{-\gamma}$.
We have the asymptotic formula for $\pi_{\mathcal{H}_3}(x, n)$ not depending of $n$, Then:
$$\displaystyle\sum_{\substack{\text{primes }p_k\leq x\\\text{such that }p_{k+1}+2\text{ is prime}}}(p_{k+1}-p_k)^2 \sim \pi^{\prime}_{\mathcal{H}_3}(x) \left( \displaystyle\sum_{\substack{n \leq N(x) \\ n = 6k, k \in \mathbb{N}^*}}n^2 + \displaystyle\sum_{\substack{n \leq N(x) \\ n = 6k+4, k \in \mathbb{N}}}n^2 \right)$$
With $\pi^{\prime}_{\mathcal{H}_3}(x) = \pi_{\mathcal{H}_3}(x, 4)$ as example.