Calculating 2-tailed p-value for binomial test in R > n = 30
> p_hat = 0.8
> mu1 = 0.35
> sd1 = sqrt(30 * 0.35 * (1 - 0.35))
> z1 = (p_hat - mu1)/sd1
> p_value1 = 2*pnorm(z1)
> p_value1
[1] 1.1368

So here I have a sample of 30 observations. My sample proportion is 0.8. I'm testing H0: p = 0.35 vs. p != 0.35. However the p-value is greater than 1? Which is not possible...Where did I go wrong?
 A: You are actually performing a proportion test. For this test, the formula for sd1 is incorrect. The formula is $sd_1=\sqrt{\frac{\mu_1 (1-\mu_1)}{n}}$. Also, since $\hat{p} > \mu_1$, you want to run pnorm(z1, lower.tail=FALSE)
n = 30
p_hat = 0.8
mu1 = 0.35
sd1 = sqrt(mu1 * (1 - mu1) / n)
z1 = (p_hat - mu1)/sd1
p_value1 = 2 * pnorm(z1, lower.tail = FALSE)
p_value1

[1] 2.372164e-07

This test uses a normal approximation to the binomial distribution. One rule of thumb is that $np>5$ and $n(1-p)>5$ which is true here. There are other rules of thumb.
The binomial test is an exact test that uses the binomial distribution to get an exact count of how often $\hat{p}$ would happen under the null hypothesis. You can run it in R using binom.test. It makes no assumptions about $np$ or $n(1-p)$. However, since it is an exact test, not every p-value is possible.
A: You are only allowed to approximate the Binomial distribution if $np_0(1-p_0)>9$. Furthermore do you see that in your code for all
p_hat>mu1 => z1>0 => pnorm(z1)>1

So this calculation is also wrong. The right way: 
binom.test(24, 30, 0.3, alternative="two.sided")
data:  24 and 30
number of successes = 24, number of trials = 30, p-value = 2.194e-08
alternative hypothesis: true probability of success is not equal to 0.3
95 percent confidence interval:
 0.6143335 0.9228645
sample estimates:
probability of success 
                   0.8 

A: The thing to realize is that by default, the distribution function (pbinom()) / the CDF is the proportion of the area under the curve less than / to the left of the specified quantile.  On the other hand, a p-value is the area as far or further than the quantile under the null.  Thus, when your value is to the left of the null value, these are the same, but if your quantile is to the right, you need 1-pnorm().  
In addition, your standard error is incorrect.  The variance is $\pi_0(1-\pi_0)$, so the standard error is $\sqrt{\pi_0(1-\pi_0) / N}$.  Try:  
n = 30
p_hat = 0.8
mu1 = 0.35

sd2 = sqrt( (0.35*(1 - 0.35))/ 30)
z1 = (p_hat - mu1)/sd2

p_value2 = 2*(1-pnorm(z1))
p_value2
# [1] 2.372164e-07

Here I still used the normal approximation, but the result agrees well with @HOSS_JFL's use of the official binom.test() function.  
A: n = 30
p_hat = 0.8
mu0 = 0.35*30
mu1=30*0.8
sd1 = sqrt(30 * 0.35 * (1 - 0.35))
z1 = (mu1-mu0)/sd1
p_value1 = 2*(1-pnorm(z1))
p_value1
# p-value:
[1] 2.372164e-07

By the way
$Z=\frac{p_1-p_0}{\sqrt{p_0(1-p_0)/n}}=\frac{np_1-np_0}{\sqrt{np_0(1-p_0)}}$
