So let's say you have $n$ observations, summarized in a Bernoulli variable $\def\Bin{\text{Bin}} \def\arcsin{\text{arcsin}} \def\N{\mathcal{N}} X\sim \Bin(n, \pi)$, and you want to chose between $\pi = q$ and $\pi = x$; I will change the notations and use $\pi = q_1$ and $\pi = q_2$ instead, with $q_1 < q_2$.
To avoid problems with the variance of $X$ and focus on the mean, we will use a variance stabilizing transformation: let $\phi(x) = \arcsin\sqrt x$ ; we have approximately (for $n$ big enough)
$$\phi(X) \sim \N\left(\phi(\pi), {1\over 4n}\right).$$
So we need to chose between $\phi(\pi) = \phi(q_1)$ and $\phi(\pi) = \phi(q_2)$. You have two different risks to control: $\alpha$, the risk of choosing $\phi(\pi) = \phi(q_2)$ while the true value is $\phi(q_1)$, and $\beta$, the risk of choosing $\phi(\pi) = \phi(q_1)$ while the true value is $\phi(q_2)$.
The natural rule of decision is to pick a threshold $s$ between $\phi(q_1)$ and $\phi(q_2)$, and chose $\phi(q_1)$ when $\phi(X) < s$; if $\phi(X) > s$ you will chose $\phi(q_2)$.
Given our choise of $s$, when $\phi(\pi) = \phi(q_1)$ we erroneously choose $\phi(q_2)$ with probability
$$\alpha = Pr( \phi(X) > s)$$
Since $\phi(\pi) = \phi(q_1)$ we can observe that $\phi(X) \sim\N\left(\phi(q_1), {1\over 4n}\right)$; standard manipulations lead to
$$\alpha = Pr\bigl(Z > 2\sqrt n(s - \phi(q_1))\bigr)$$
for $Z\sim\N(0,1)$. Similarly, when $\phi(\pi) = \phi(q_2)$ we erroneously choose $\phi(q_1)$ with probability
$$\beta = Pr\bigl(Z < 2\sqrt n(s - \phi(q_2))\bigr).$$
Let's say both kind of mistakes are equally damaging, and you want both to be equally small. In that case, you chose $s = {1\over 2}(\phi(q_1)+\phi(q_2))$, and you have
$$\alpha = \beta = Pr\bigl(Z > \sqrt n(\phi(q_2) - \phi(q_1))\bigr).$$