Horizontal line between text blocks that's omitted at pagebreak

From an old solution of mine that can be used here too (https://tex.stackexchange.com/a/396216/120578) (I used your command combined with mine):

\documentclass[paper=a5]{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage{blindtext}

\newsavebox{\mybottombox} % Box to save the text of the command 
\newlength{\mybottomlength} % The length of our text inside the command
\newlength{\availafter} % The available length left on the page after placing our text

% Optional argument is the minimum length after the nobottom text for not pagebreak. Change it to your needs
\newcommand{\nobottom}[2][40pt]{\savebox{\mybottombox}{\vbox{#2}}\setlength{\mybottomlength}{\ht\mybottombox}%
\setlength{\availafter}{\dimexpr\textheight-\mybottomlength-\pagetotal\relax}\ifdim\availafter<#1%
\pagebreak%\noindent\usebox{\mybottombox}%
\else%
\noindent\usebox{\mybottombox}%
\fi%
}%

\newcommand{\mycommand}[1]{%
  #1\vspace{.1ex}\par%
  \nobottom{\noindent\begin{center}\rule{.25\textwidth}{0.4pt}\end{center}\vspace{.1ex}}%
}

\begin{document}

\mycommand{\blindtext[2]}
\mycommand{some text some text some text some text some text some text some text}
\mycommand{some text some text some text some text some text some text some text}
\end{document}

Output:

enter image description here

I just not adding the line if it is at the bottom of the page. The bottom, is defined in the optional argument of my command \nobottom and for the example I used 40pt.

We can also give my optional argument as optional to your command too if needed for specific paragraphs.