Replace the lines with comments between the text and the algorithm by blank lines and use \SetAlgoSkip{bigskip}
before the algorithm or in preamble.
Explanation
algorithm2e
provides \SetAlgoSkip
to add spaces before and after the algorithm.
There are four possibilities:
\SetAlgoSkip{}
for no extra vertical skip
\SetAlgoSkip{smallskip}
to act as the default behaviour
\SetAlgoSkip{medskip}
to have a bigger skip
\SetAlgoSkip{bigskip}
to have the bigger skip
You can also define a command with a custom skip and pass its name (without \
) to \SetAlgoSkip
.
Examples
Using \SetAlgoSkip{bigskip}
:
\documentclass[a4paper]{article}
\usepackage{algorithm2e}
\usepackage{float}
%\usepackage[font={small,it}]{caption}
\usepackage[font=small,labelfont=bf,
justification=justified,
format=plain]{caption}
\SetAlgoSkip{bigskip} % <------ added
\begin{document}
We can finally state the algorithm:
\begin{algorithm}[H]
\While{$(k<niter)$}{
do something
}
\caption{Topology optimization algorithm}
\end{algorithm}
\noindent Moreover some text:
\end{document}

Using custom spacing (defining new command):
\documentclass[a4paper]{article}
\usepackage{algorithm2e}
\usepackage{float}
%\usepackage[font={small,it}]{caption}
\usepackage[font=small,labelfont=bf,
justification=justified,
format=plain]{caption}
\newcommand{\SkipBeforeAndAfter}{\vspace{1cm}} % <------ added
\begin{document}
We can finally state the algorithm:
\SetAlgoSkip{SkipBeforeAndAfter} % <------ added (without \)
\begin{algorithm}[H]
\While{$(k<niter)$}{
do something
}
\caption{Topology optimization algorithm}
\end{algorithm}
\noindent Moreover some text:
\end{document}

Extra
If you want to define different spaces for before and after the algorithm, one possibility is to do the following:
\documentclass[a4paper]{article}
\usepackage{algorithm2e}
\usepackage{float}
%\usepackage[font={small,it}]{caption}
\usepackage[font=small,labelfont=bf,
justification=justified,
format=plain]{caption}
\usepackage{etoolbox}% <---- needed for this solution
\providetoggle{beginFlag}
\settoggle{beginFlag}{true}
\newcommand{\SkipBeforeAndAfter}{%
\iftoggle{beginFlag}{%
\settoggle{beginFlag}{false}%
\vspace{\baselineskip}% <---- initial space (before)
}{%
\settoggle{beginFlag}{true}%
\vspace{3\baselineskip}% <---- final space (after)
}%
}
\SetAlgoSkip{SkipBeforeAndAfter}
\begin{document}
We can finally state the algorithm:
\begin{algorithm}[H]
\While{$(k<niter)$}{
do something
}
\caption{Topology optimization algorithm}
\end{algorithm}
\noindent Moreover some text:
\end{document}
