eacal, noncompeting, 386 bytes
init .
define @ curry push .
define ~ curry exec .--func
alias $ strap
alias ' string
set n set m cast number arg number 0
set s empty string
label l
@ get n
set n ~ dec
@ space
@ get n
$ ~ repeat
$ ' /----/
@ space
@ get m
@ get n
@ ~ sub
@ ~ dec
@ number 2
@ ~ mul
$ ~ repeat
$ ' \
$ newline
@ get n
@ number 0
if ~ more
goto l
@ $
@ regex gm ' ( {4})(?=.$)
@ ' \$1
print ~ replace
I have officially made the most verbose language possible. I have officially made the most verbose language possiblecomment in jest and in sarcasm. Please calm down. Instructions on how to run in the github repo linked in the header.
Ungolfed
init .
set n set m cast number arg number 0
set s empty string
label loop
push . get n
set n exec .--func dec
push . space
push . get n
strap exec .--func repeat
strap string /----/
push . space
push . get m
push . get n
push . exec .--func sub
push . exec .--func dec
push . number 2
push . exec .--func mul
strap exec .--func repeat
strap string \
strap newline
push . get n
push . number 0
if exec .--func more
goto loop
push . strap
push . regex gm string ( {4})(?=.$)
push . string \$1
print exec .--func replace