This is a Monte Carlo simulation, though I doubt it's doing what you want, and really is of no practical use. What you are comparing is 10000 single sample studies and determining how many of these individual observed values are on average higher. So, it's probably better to conceptualize your code as the following less efficient code:
runs <- 10000
result <- logical(runs)
for(i in 1:runs){
a <- rnorm(1, mean = 0)
b <- rnorm(1, mean = 0)
result[i] <- a > b
}
mc.p.value <- mean(result)
The above code, when the distributions are equal, should show that $a$ is higher than $b$ 50% of the time, but this type of result is essentially useless in practice because you would only have $N=2$, and statistical inferences are not applicable (i.e., there is no variance within each group available to quantify sampling uncertainty).
What you are missing is comparing two summary statistics of interest to determine their sampling properties, which is generally the topic of statistical inference and requires at least a minimum number of data points to quantify some form of sampling uncertainty.
As it stands this is generally a standard independent $t$-test set-up. So, you could compare a number of things, such as how often the first group mean is higher than the second, how often a $t$-test gives a $p < \alpha$ result (or analogously, how often the $|t|$ ratio is greater than the cut-off), and so on.
E.g., ifIf $n=20$ for each group and the distributions are equal in the population then
runs <- 10000
n <- 20
alpha <- .05
result.p <- result.mean <- numeric(runs)
for(i in 1:runs){
a <- rnorm(n, mean = 0)
b <- rnorm(n, mean = 0)
result.mean[i] <- mean(a) > mean(b)
result.p[i] <- t.test(a, b)$p.value
}
mc.p.value <- mean(result.p < alpha)
mc.a_gt_b.value <- mean(result.mean < alpha)
Playing around with the other parameters, such as changing the first group mean to 1, will change the nature of the simulation (turningchanging it from a Type I error simulation, as it is now, to a power study).