What about having five boards to draw? Or eight?
Here's an implementation that accepts any number of boards and outputs them in pairs in figure environments. If the number is odd, the last one is output by itself in another figure.
\documentclass{article}
\usepackage[
a4paper,
hmargin = 2.4cm,
vmargin = 3cm
]{geometry}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{xcolor}
\usepackage{xparse}
\usepackage{xskak}
\setchessboard{smallboard}
\ExplSyntaxOn
\NewDocumentCommand{\opgaverLoesninger}{m}
{
\svend_opgaver_loesninger:n { #1 }
}
\tl_new:N \l__svend_opgaver_final_tl
\seq_new:N \l__svend_opgaver_tables_in_seq
\seq_new:N \l__svend_opgaver_tables_out_seq
\cs_new_protected:Nn \svend_opgaver_loesninger:n
{
\seq_set_split:Nnn \l__svend_opgaver_tables_in_seq { \\ } { #1 }
\seq_clear:N \l__svend_opgaver_tables_out_seq
\seq_map_inline:Nn \l__svend_opgaver_tables_in_seq
{
\seq_put_right:Nx \l__svend_opgaver_tables_out_seq
{
\__svend_opgaver_board:nn
{ \clist_item:nn { ##1 } { 1 } }
{ \clist_item:nn { ##1 } { 2 } }
\__svend_opgaver_caption:n { \clist_item:nn { ##1 } { 3 } }
}
}
\__svend_opgaver_make_tables:
}
\cs_new_protected:Nn \__svend_opgaver_board:nn
{
\newgame
\fenboard{#2 ~ #1 ~ - ~ - ~ 0 ~ 1 }
}
\cs_new_protected:Nn \__svend_opgaver_caption:n
{
\scalebox{1.2}{\showboard}\par
\vspace*{2ex}
{\LARGE Løsning: ~ \textcolor{blue}{#1}}
}
\cs_new_protected:Nn \__svend_opgaver_make_tables:
{
\tl_clear:N \l__svend_opgaver_final_tl
\int_if_odd:nT { \seq_count:N \l__svend_opgaver_tables_out_seq }
{
\seq_pop_right:NN \l__svend_opgaver_tables_out_seq \l__svend_opgaver_final_tl
}
\int_step_inline:nnnn { 1 } { 2 } { \seq_count:N \l__svend_opgaver_tables_out_seq }
{
\begin{figure}[!htbp]
\begin{minipage}[b]{0.5\textwidth}
\centering
\seq_item:Nn \l__svend_opgaver_tables_out_seq { ##1 }
\end{minipage}
\begin{minipage}[b]{0.5\textwidth}
\centering
\seq_item:Nn \l__svend_opgaver_tables_out_seq { ##1+1 }
\end{minipage}
\end{figure}
}
\tl_if_empty:NF \l__svend_opgaver_final_tl
{
\begin{figure}[!htbp]
\centering
\tl_use:N \l__svend_opgaver_final_tl
\end{figure}
}
}
\ExplSyntaxOff
\begin{document}
\opgaverLoesninger{
w, 6k1/6p1/1p5p/3r4/1P6/6P1/4B1KP/8, Lc4 \\
w, 1k6/pp6/2p3p1/4n1P1/8/P6P/KP1B4/8, Lf4 \\
w, 8/1p4kp/p5p1/B7/3n4/1P5P/2P3P1/6K1, Lc3 \\
w, k7/p6p/1p4p1/3r4/1P5P/P5P1/1KB5/8, Le4 \\
w, k7/p6p/1p4p1/3r4/1P5P/P5P1/1KB5/8, Le4
}
\end{document}
Instead of a syntax with braces, separating boards with \\ and data in each one with commas is simpler and more readable.


With slight changes, you can also set the magnification for the boards (default 1.2) and the number of boards per row (default 2).
The magnification is changed with mag=<factor>, the number of boards per row is set with n=<number> in the optional argument to \opgaverLoesninger.
The option single (a boolean, single=true is implicit) will make a single figure environment, but you're responsible for it to fit on a page, of course. It is present in the example just by way of example. If you try \opgaverLoesninger[single]{...} (same mandatory argument for five boards), the float will be too large (not with four boards).
\documentclass{article}
\usepackage[
a4paper,
hmargin = 2.4cm,
vmargin = 3cm
]{geometry}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{xcolor}
\usepackage{xparse}
\usepackage{xskak}
\setchessboard{smallboard}
\ExplSyntaxOn
\NewDocumentCommand{\opgaverLoesninger}{O{}m}
{
\keys_set:nn { svend/opgaver } { n=2, mag=1.2, single=false, #1 }
\svend_opgaver_loesninger:n { #2 }
}
\keys_define:nn { svend/opgaver }
{
n .int_set:N = \l__svend_opgaver_n_int,
mag .tl_set:N = \l__svend_opgaver_mag_tl,
single .bool_set:N = \l__svend_opgaver_single_bool,
single .default:n = true,
}
\tl_new:N \l__svend_opgaver_final_tl
\seq_new:N \l__svend_opgaver_tables_in_seq
\seq_new:N \l__svend_opgaver_tables_out_seq
\cs_new_protected:Nn \svend_opgaver_loesninger:n
{
\seq_set_split:Nnn \l__svend_opgaver_tables_in_seq { \\ } { #1 }
\seq_clear:N \l__svend_opgaver_tables_out_seq
\seq_map_inline:Nn \l__svend_opgaver_tables_in_seq
{
\seq_put_right:Nx \l__svend_opgaver_tables_out_seq
{
\__svend_opgaver_board:nn
{ \clist_item:nn { ##1 } { 1 } }
{ \clist_item:nn { ##1 } { 2 } }
\__svend_opgaver_caption:n { \clist_item:nn { ##1 } { 3 } }
}
}
\__svend_opgaver_make_tables:
}
\cs_new_protected:Nn \__svend_opgaver_board:nn
{
\newgame
\fenboard{#2 ~ #1 ~ - ~ - ~ 0 ~ 1 }
}
\cs_new_protected:Nn \__svend_opgaver_caption:n
{
\scalebox{\l__svend_opgaver_mag_tl}{\showboard}\par
\vspace*{2ex}
{\LARGE Løsning: ~ \textcolor{blue}{#1}}
}
\cs_new_protected:Nn \__svend_opgaver_make_tables:
{
\bool_if:NT \l__svend_opgaver_single_bool { \begin{figure}[!htbp] \centering }
\int_step_inline:nnnn
{ 1 } % start
{ \l__svend_opgaver_n_int } % step
{ \seq_count:N \l__svend_opgaver_tables_out_seq } % end
{
\bool_if:NF \l__svend_opgaver_single_bool { \begin{figure}[!htbp] \centering }
\int_step_inline:nnnn { 0 } { 1 } { \l__svend_opgaver_n_int - 1 }
{
\tl_if_empty:xF
{ \seq_item:Nn \l__svend_opgaver_tables_out_seq { ##1+####1 } }
{
\begin{minipage}[b]{ \dim_eval:n { \textwidth/\l__svend_opgaver_n_int } }
\centering
\seq_item:Nn \l__svend_opgaver_tables_out_seq { ##1+####1 }
\end{minipage}
}
}
\bool_if:NTF \l__svend_opgaver_single_bool { \\ \bigskip } { \end{figure} }
}
\bool_if:NT \l__svend_opgaver_single_bool { \end{figure} }
}
\cs_generate_variant:Nn \tl_if_empty:nF { x }
\ExplSyntaxOff
\begin{document}
\opgaverLoesninger[mag=0.5,n=4,single]{
w, 6k1/6p1/1p5p/3r4/1P6/6P1/4B1KP/8, Lc4 \\
w, 1k6/pp6/2p3p1/4n1P1/8/P6P/KP1B4/8, Lf4 \\
w, 8/1p4kp/p5p1/B7/3n4/1P5P/2P3P1/6K1, Lc3 \\
w, k7/p6p/1p4p1/3r4/1P5P/P5P1/1KB5/8, Le4 \\
w, k7/p6p/1p4p1/3r4/1P5P/P5P1/1KB5/8, Le4
}
\end{document}

\opgaverLoesningerEkstrais never called and o \tempB is undefined at the first \fenboard. Beside this I don't understand what you are trying to do and imho commands with more than 3 or 4 arguments are madness. – Ulrike Fischer Nov 05 '17 at 16:50\\separated list to allow arbitrary arguments\foo{a,b,c,d,e,f,g,h,i,j,k}one argument with a list, not\foo{a}{b}{c}{d}{e}{f}{g}{h}{i}{j}{k}– David Carlisle Nov 05 '17 at 16:53