I think Riemann Hypothesis is related to the size of the fractional part of your formula.
RH implies: $$ \pi(x) > li(x) -\sqrt{x}\log{x}/(8 \pi) \text{ if } 2657 \le x \qquad (1)$$
Suppose your formula holds and write $$ \lfloor \log{n} -\frac12 \rfloor = \log{n} -\frac12 - \alpha \qquad (2) $$ where $\alpha$ is the fractional of $\log{n} -\frac12$
Suppose $ 0 < \alpha \le \frac12$, substitute. By your formula and (2) in$\pi(n)=n/(\log{n} -\frac12 - \alpha)$ and in (1) and compute the limit at infinity.:
$$ x/(\log{x} -\frac12 - \alpha) > li(x) -\sqrt{x}\log{x}/(8 \pi) \qquad (3)$$
According to both Maple and Wolfram alpha the limit at infinity of (3) violates RH, so RH implies $\alpha > \frac12$ whenever your formula holds and $n$ is large enough. (Probably (3) violates RH for $n> 3000$ , not sure).
OEIS A057809 Numbers n such that pi(n) divides n has 296 entries, the larges of which is $75370126416$.
$\alpha \le \frac12$ happens only 14 times ending at $a(n)=1092$.