I suspect the only reason you want this smooth break is because non-floating algorithm that you wish to break across a page. For that, I've created a nofloatalgorithmic environment that takes an optional argument for the line numbering (just like the regular algorithmic environment does) and a mandatory argument for the algorithm caption*.

\documentclass{article}
\usepackage[paper=a6paper]{geometry}% Just for this example
\usepackage{algorithm,needspace}
\usepackage{algcompatible}
\makeatletter
\newenvironment{nofloatalgorithmic}[2][0]
{% \begin{nofloatalgorithmic}
\par
\addvspace{\intextsep}% Vertical gap above in-text float
\needspace{\dimexpr\baselineskip+6.8pt}%
\noindent%
\hrule height.8pt depth0pt \kern2pt% Top horizontal rule
\refstepcounter{algorithm}% Step algorithm counter
\addcontentsline{loa}{algorithm}{\numberline{\thealgorithm}#2}% Add entry to LoA
\noindent\textbf{\fname@algorithm~\thealgorithm} #2\par% Write caption
\kern2pt\hrule\kern2pt% Middle horizontal rule
\begin{algorithmic}[#1]
}
{% \end{nofloatalgorithmic}
\end{algorithmic}
\nobreak\kern2pt\hrule\relax% Bottom horizontal rule
\addvspace{\intextsep}% Vertical gap below in-text float
}
\makeatother
\begin{document}
\listofalgorithms
\begin{nofloatalgorithmic}[1]{Some algorithm}
\State $a \gets b$
\State some other code
\State some code that could possibly be wrap onto the next side
\State $a \gets b$
\State some other code
\State some code that could possibly be wrap onto the next side
\State $a \gets b$
\State some other code
\State some code that could possibly be wrap onto the next side
\State $a \gets b$
\State some other code
\State some code that could possibly be wrap onto the next side
\State $a \gets b$
\State some other code
\State some code that could possibly be wrap onto the next side
\State $a \gets b$
\State some other code
\State some code that could possibly be wrap onto the next side
\State $a \gets b$
\State some other code
\State some code that could possibly be wrap onto the next side
\State $a \gets b$
\State some other code
\State some code that could possibly be wrap onto the next side
\end{nofloatalgorithmic}
\begin{algorithm}[h]
\caption{Another algorithm}
\begin{algorithmic}[1]
\State $a \gets b$
\State some other code
\end{algorithmic}
\end{algorithm}
\end{document}
The caption is generated in the same way the algorithm package does it. In fact, algorithm uses float to set the floating algorithm in a ruled style which uses the following "pre", "mid" and "post" definitions for the caption:
\newcommand\fs@ruled{\def\@fs@cfont{\bfseries}\let\@fs@capt\floatc@ruled
\def\@fs@pre{\hrule height.8pt depth0pt \kern2pt}%
\def\@fs@post{\kern2pt\hrule\relax}%
\def\@fs@mid{\kern2pt\hrule\kern2pt}%
\let\@fs@iftopcapt\iftrue}
needspace makes sure the new caption sticks to the actual page-breakable list (that is algorithmic).
Finally, since this is set as an in-text float, a gap above and below of \intextsep sets it apart form the regular paragraph text in true float-like fashion, as suggested by this view of lengths used in float (from the layouts documentation):

Ps. I've not tested this extensively to make sure page breaks don't screw/split up the horizontal rules, so let me know if there are problems.
*This definition can be extended to take an additional optional argument that could be used for a different LoA-style entry.