I'm using the solution by karlkoeller to biblatex: pagebackref reference in the flush right margin and like the result. However, the list of backrefs does not break to a newline which is problematic if an entry is referenced too often with the list of backrefs crossing the page margin.
Is there a way to a) make them break before the page margin and b) move the next bib entry down if necessary. I'm also interested in other visually appealing ways to display backrefs.
MWE
\documentclass{article}
\usepackage{times}
\usepackage{csquotes}
\usepackage{xcolor}
\usepackage[style=numeric-comp,backref=true,backend=biber]{biblatex}
\usepackage{filecontents}
\usepackage{pgffor}
\begin{filecontents}{\jobname.bib}
@book{saad00,
title = {Iterative Methods for Sparse Linear Systems},
year = {2000},
author = {Y. Saad}}
@book{vonNMorg44,
title = {Theory of Games and Economic Behavior},
year = {1944},
author = {J. von Neumann and O. Morgenstern}}
\end{filecontents}
\addbibresource{\jobname.bib}
% pagereference in the right margin
\renewbibmacro*{pageref}{%
\iflistundef{pageref}
{\renewcommand{\finentrypunct}{\addperiod}}
{\renewcommand{\finentrypunct}{\addspace}%
\printtext{\addperiod\hfill\rlap{\hskip15pt\colorbox{blue!5}{\scriptsize\printlist[pageref][-\value{listtotal}]{pageref}}}}}}
\begin{document}
\foreach \n in {0,...,20}{text \cite{vonNMorg44} \newpage text \newpage}
\nocite{saad00}
\printbibliography
\end{document}

