  Modified gravity (MG) theories have emerged as a promising alternative to
explain the late-time acceleration of the Universe. However, the detection of
MG in observations of the large-scale structure remains challenging due to the
screening mechanisms that obscure any deviations from General Relativity (GR)
in high-density regions. The marked two-point correlation function offers a
promising approach to potentially detect MG signals. This work investigates
novel marks based on large-scale environment estimates but also that exploit
the anti-correlation between objects in low- and high-density regions. This is
the first time discreteness effects in density-dependent marked correlation
functions are investigated in depth. We assess the performance of various marks
to distinguish GR from MG by using the ELEPHANT simulations, comprised of
realisations of GR as well as $f(R)$ and nDGP gravity. In addition,
discreteness effects are studied using the high-density Covmos catalogues. We
establish a robust method to correct for shot-noise effects that allows the
recovery of the true signal with an accuracy below $5\%$ over a wide range of
scales. We find such correction to be crucial to measure the amplitude of the
marked correlation function in an unbiased manner. Furthermore, we demonstrate
that marks, anti-correlating objects in low- and high-density regions, are
among the most effective in distinguishing between MG and GR. We report
differences in the marked correlation function between $f(R)$ with
$|f_{R0}|=10^{-6}$ and GR simulations of the order of 3-5$\sigma$ in real space
up to scales of about $80\, h^{-1} \, {\rm Mpc}$. The redshift-space monopole
exhibits similar features and performances. The combination of the proposed
$\tanh$-mark with shot-noise correction paves the way towards an optimal
approach for the detection of MG in current and future galaxy spectroscopic
surveys.
