The insertion of \@gobble at the start of \foorows in the linked answer is meant to gobble the first & of the row. You can insert \hline just before that to always insert a horizontal rule with every \addtotable:

\documentclass{article}
\newcommand\foorows{}
\makeatletter
\newcommand\addtotable[1]{%
\g@addto@macro\foorows{\hline\@gobble}% Insert horizontal rule and gobble first &
\@for\tmp:=#1\do{%
\expandafter\g@addto@macro\expandafter\foorows
\expandafter{\expandafter&\tmp}%
}%
\g@addto@macro\foorows{\\}%
}
\makeatother
\begin{document}
\addtotable{R1C1,R1C2,R1C3,R1C4}
\addtotable{R2C1,R2C2,R2C3,R2C4}
\begin{table}[htp]
\centering
\begin{tabular}{ |c|c|c|c| }
\hline
Header 1 & Header 2 & Header 3 & Header 4 \\ \hline % Header row
\foorows
\hline
\end{tabular}
\end{table}
\end{document}