The code below shows an improved version of the code provided in this answer to Mark (highlight) a paragraph (\item{...}) with a squiggly line for later attention. The environment tikzborder uses a TikZ decoration to draw a squiggly line to the right of the text (even if page breaks occur); the optional argument controls the separation between the text and the line (the document has to be processed three times).
The idea is simple: marks are placed at the beginning and at the end of the environment and then the decoration is drawn between the marks; labels are used at the beginning and at the end, to decide if the marks are in the same page or not and act accordingly.
\documentclass{article}
\usepackage{atbegshi}
\usepackage{refcount}
\usepackage{tikz}
\usetikzlibrary{decorations.pathmorphing,calc}
\usepackage{lipsum}
\newcounter{bordercntr}
\newcounter{borderpages}
\newcommand\tikzmark[1]{%
\tikz[overlay,remember picture] \node (#1) {};}
\newenvironment{tikzborder}[1][0pt]
{%
\gdef\borderspacing{#1}
\stepcounter{bordercntr}%
\tikzmark{start-border}\label{start-border\thebordercntr}%
% if the marks are in the same page, nothing is done
% otherwise, the decoration is drawn from the starting point to the page bottom
% and, if necessary, intermediate pages will also receive the decoration
\ifnum\getpagerefnumber{start-border\thebordercntr}=\getpagerefnumber{end-border\thebordercntr} \else
\begin{tikzpicture}[overlay, remember picture]
\draw [decoration={coil,aspect=0},decorate,ultra thick,gray]
let \p1 = (start-border.north), \p2 = (end-border), \p3 = (current page.center) in%
( $ (\x3,\y1) + (.55\textwidth+#1,2pt) $ ) -- ( $ (\x3,\y3) + (0.55\textwidth+#1,-0.5\textheight) $ );
\end{tikzpicture}%
\setcounter{borderpages} {\numexpr\getpagerefnumber{end-border\thebordercntr}-\getpagerefnumber{start-border\thebordercntr}}\theborderpages
\ifnum\value{borderpages}>1
\AtBeginShipoutNext{\tikzborderpage[#1]}%
\fi
\fi%
}
{\tikzmark{end-border}\label{end-border\thebordercntr}
% if the marks are in the same page, the decoration is drawn
% otherwise, the decoration is drawn from the top of the page to the end mark
\ifnum\getpagerefnumber{start-border\thebordercntr}=\getpagerefnumber{end-border\thebordercntr}
\begin{tikzpicture}[overlay, remember picture]
\draw [decoration={coil,aspect=0},decorate,ultra thick,gray]
let \p1 = (start-border.north), \p2 = (end-border), \p3 = (current page.center) in
( $ (\x3,\y1) + (.55\textwidth+\borderspacing,2pt) $ ) -- ( $ (\x3,\y2) + (.55\textwidth+\borderspacing,10pt) $ );
\end{tikzpicture}%
\else
\begin{tikzpicture}[overlay, remember picture]
\draw [decoration={coil,aspect=0},decorate,ultra thick,gray]
let \p1 = (start-border.north), \p2 = (end-border), \p3 = (current page.center) in
( $ (\x3,\y3) + (.55\textwidth+\borderspacing,.5\textheight-6pt) $ ) -- ( $ (\x3,\y2) + (.55\textwidth+\borderspacing,10pt) $ );
\end{tikzpicture}%
\fi%
}
% the command to draw the decoration in intermediate pages from the top
% to the bottom of the page
\newcommand\tikzborderpage[1][0pt]{%
\begin{tikzpicture}[overlay, remember picture]
\draw [decoration={coil,aspect=0},decorate,ultra thick,gray]
let \p1 = (current page.center) in
( $ (\x1,\y1) + (.55\textwidth+#1,0.5\textheight-15pt) $ ) -- ( $ (\x1,\y1) + (.55\textwidth+#1,-0.5\textheight) $ );
\end{tikzpicture}
\addtocounter{borderpages}{-1}%
\ifnum\value{borderpages}>1
\AtBeginShipoutNext{\tikzborderpage[#1]}%
\fi%
}
\begin{document}
\begin{tikzborder}
\lipsum[2]
\end{tikzborder}
\begin{tikzborder}[-5pt]
\lipsum[2]
%\begin{tikzborder}
\lipsum[2]
%\end{tikzborder}
\end{tikzborder}
\end{document}
The problem is that now I want to nest tikzborder environments and this is not working, as can be seen by uncommenting out the inner environment in the code above and reprocessing the document.
I think I need some mechanism to stack the marks, but I don't know how to implement this kind of mechanism. Of course, perhaps another approach allowing correct nesting of the environment could be better, and I would also be willing to hear about it.

tikzborder, this work well. – Peter Grill Oct 12 '12 at 03:05itemizedlists in Enclose an entry in an enumerate list in parentheses. I did not fully solve the nesting issue, but I think the solution is applicable here. Let me see I can incorporate it into this. – Peter Grill Oct 12 '12 at 03:52bordercntrso perhaps the logic can be simplified further. – Peter Grill Oct 12 '12 at 04:21