Given a continuous random variable $X$ with finite expectation, I would like to show the following statement: $$\mathbb{E}(|X|) = \frac{1}{\pi} \int_{\mathbb{R}} \frac{1-Re(\varphi (t))}{t^2} dt, \tag{1} $$ where $\varphi (t) := \int_{\mathbb{R}} e^{itx}p(X=x)dx$ is the characteristic function of $X$.
What I have attempted so far is to first express $p(|X|=x)$ by $$p(|X|=x) = \frac{d}{dx}[F_{|X|}(x) - F_{|X|}(-x)] = \frac{d}{dx}\int_{\mathbb{R}} \frac{e^{itx} - e^{-itx}}{2\pi it}\varphi(t)dt = \frac{d}{dx}\int_{\mathbb{R}} \frac{\sin(tx)}{\pi t}\varphi(t)dt,$$ where the second equality follows from the inversion theorem.
Then the expectation of $|X|$ can be computed by $$\mathbb{E}(|X|) = \int_{\mathbb{R^+}} x (\frac{d}{dx}\int_{\mathbb{R}} \frac{\sin(tx)}{\pi t}\varphi(t)dt)dx. \tag{2}$$
However, I am stuck here and cannot find a way to turn this expression $(2)$ into $(1)$. My question is, is there a way to obtain $(1)$ by swtiching the order of integration?
Your approach is faulty. Your are not dealing with discrete random variables so $p(|X|=x)$ has no relevance here.
$\int \frac {1-Re \phi (t)} {t^{2}}dt=\int \frac {1-Re Ee^{itX}} {t^{2}}dt=\int \frac {1- E\cos (t|X|)} {t^{2}}dt$ since $\cos $ is an even function. You can interchange the integral and the expectation by Tonelli's Theorem so we get $E(\int \frac {1- \cos (t|X|)} {t^{2}}dt)$. Make the change of variable $y=t|X|$ and use the fact that $\int \frac {1-cos y} {y^{2}}dy=\pi$ to complete the proof.