Here is a completely revamped version of the coderule environment. This time using the mdframed environment from the similarly-named mdframed package. The package is loaded with the framemethod=tikz, thinking that you're compiling your document using pdflatex.
Although mdframed produces a framed environment, we set the top, bottom and right margins and lines to 0pt, and adjust only the left margin specifications. mdframed naturally breaks across a page without problem, thereby providing the required functionality by default.
In the following minimal example, the coderule environment takes 3 optional arguments:
\begin{coderule}[<rule width>][<rule sep>][<rule colour>]
...
\end{coderule}
The width of the rule is set by the first optional argument <rule width> (default is 1em), while the separation between the rule and the paragraph text is set by the second <rule sep> (default is 1em). Finally, the third optional argument allows you to modify the colour to suit your needs (default is black).

\documentclass{article}
\usepackage{lipsum}% http://ctan.org/pkg/lipsum
\usepackage{amsmath}% http://ctan.org/pkg/amsmath
\usepackage[framemethod=tikz]{mdframed}% http://ctan.org/pkg/mdframed
\usepackage{xparse}% http://ctan.org/pkg/xparse
\NewDocumentEnvironment{coderule}{O{1em} O{1em} O{black}}%
{% \begin{coderule}[<rule width>][<rule sep>][<rule colour>]
\allowdisplaybreaks[1]%
\begin{mdframed}%
[topline=false,rightline=false,bottomline=false,%
innertopmargin=0pt,innerrightmargin=0pt,innerbottommargin=0pt,%
skipabove=\parskip,skipbelow=0.3\baselineskip,%
innerleftmargin=#2,outerlinewidth=#1,linecolor=#3]
}
{\end{mdframed}}% \end{coderule}
\begin{document}
\lipsum[1] \bigskip \bigskip \bigskip
\begin{coderule}
\lipsum[2-4]
\begin{align}
f(x) &= ax^2+bx+c \
f(x) &= ax^2+bx+c \
f(x) &= ax^2+bx+c \
f(x) &= ax^2+bx+c
\end{align}
\lipsum[5-6]
\end{coderule}
\lipsum[7-8]
\begin{coderule}[2em][1em][orange]
Here is a short introduction:
\begin{align}
f(x) &= ax^2+bx+c \
f(x) &= ax^2+bx+c \
f(x) &= ax^2+bx+c \
f(x) &= ax^2+bx+c \
f(x) &= ax^2+bx+c \
f(x) &= ax^2+bx+c
\end{align}
\lipsum[5-6]
\end{coderule}
\end{document}
Of course, the choice of 3 additional arguments may be superfluous. So, that can be removed as well, or the order switched around. Also, the choice of align from amsmath is interchangeable with flalign.
xparse provided the environment definition interface, while lipsum was used for dummy text generation, Lorem Ipsum style.
coderuleenvironment. It would make it much easier for others to investigate modifications rather than re-inventing the wheel or gather information from different sources across TeX.SX. – Werner Nov 01 '11 at 15:41