The function $f(x)$ is closely related to the notion of *autocorrelation*, which for a binary sequence $x$ of length $|x|=N$ and shift $w$ can be expressed as $$\textbf{AC}_x(w) := N - 2H(x\oplus R(x,w)).$$ The values of $\textbf{AC}_x(w)$ for various non-trivial shifts (i.e. $1\leq w\leq N-1$) are called *out-of-phase autocorrelation values*. So, $$f(x) = \min_{1\leq w\leq N-1} H(x\oplus R(x,w)) = \frac{N}2 - \frac12\max_{1\leq w\leq N-1} \textbf{AC}_x(w).$$ For the known constructions for optimal binary sequence w.r.t. autocorrelation, I refer to the paper [Cai and Ding (2009)](https://doi.org/10.1016/j.tcs.2009.02.021). In particular, for $N=q-1\equiv 0\pmod{4}$, where $q$ is a power of prime, the Sidelnikov–Lempel–Cohn–Eastman construction produces a sequence $x$ with $H(x)=\frac{N}2$ and out-of-phase autocorrelation values $\{0,-4\}$, thus giving $f(x)=\frac{N}2$ as requested in the question. The value $N=256$ well fits into this construction since $q=257$ is prime.