An obvious necessary local condition is that $d\omega=0$. On the open set $U\subset X$ on which $\omega^2\not=0$, one has the further condition that the only ${\frak su}(2)$-valued connection that could have curvature $J\omega$ is one that is locally of the form $J\alpha$, where $\omega = d\alpha$. This may mean (I haven't checked the mod 2 conditions) that any such $E$ would have to restrict to $U$ to be of the form $E = L \oplus \overline L$, where $L$ is a complex line bundle with curvature $\omega$.

Here is the reasoning behind the above statements: Recall that ${\frak su}(2)$ can be regarded as the space of imaginary quaternions, with standard basis ${\bf i},{\bf j},{\bf k}$. Our curvature form can then be written as $\Omega = \omega {\bf i}$, and a potential connection form would be $\alpha = \alpha_1 \textbf{i} + \alpha_2\textbf{j} + \alpha_3 \textbf{k}$ for some (at the moment, only locally defined) $1$-forms $\alpha_i$. Now, the curvature equation $d\Omega = d\alpha + \alpha \wedge \alpha$ implies the Bianchi identity $d\Omega = \Omega \wedge \alpha - \alpha \wedge\Omega$, which unravels to the three equations $$d\omega = 0\quad\text{and}\quad \omega\wedge\alpha_2 = \omega \wedge\alpha_3 = 0.$$ Thus, $\omega$ must be closed. Moreover, if $\omega^2\not=0$, the second and third equations imply that $\alpha_2 = \alpha_3 =0$, so that one must have $\omega = d\alpha_1$, and the connection must keep the splitting of $E$ into the sum of two (conjugate) line bundles invariant under parallel translation.

There is unlikely to be a simple sufficient condition without making some constant rank assumptions on $\omega$, there are just too many possibilities.

I'll add some remarks about the case when $\omega^2=0$ but $\omega\not=0$ when I have time.

1

An obvious necessary local condition is that $d\omega=0$. On the open set $U\subset X$ on which $\omega^2\not=0$, one has the further condition that the only connection that could have curvature $J\omega$ is one that is locally of the form $J\alpha$, where $\omega = d\alpha$. This may mean (I haven't checked the mod 2 conditions) that any such $E$ would have to restrict to $U$ to be of the form $E = L \oplus \overline L$, where $L$ is a complex line bundle with curvature $\omega$.

There is unlikely to be a simple sufficient condition without making some constant rank assumptions on $\omega$, there are just too many possibilities.

I'll add some remarks about the case when $\omega^2=0$ but $\omega\not=0$ when I have time.