I stay away from over complex stuff, which is why my commands are rather limited. Anyway, plugin filter Colorize Lineart [Smart Coloring] uses close_binary. Play with it to get a more intuitive sense.
However, at least I found that a reduced number of pixel set improve the result considerably! Still there is a small piece not closed, not understandable for me!
You should probably enclose your code in `` because the forum changes .. to ....
I didn’t mention this before but I could totally understand why the algorithm couldn’t close the gap: the gap is an edge case. Pardon my triple pun.
This is not what you want but I would start by doing a closing
gmic input.tif (0,1,0;1,1,1;0,1,0) +erode.. . rm.. xor close_binary 100,2,20,10,180,1,5,1 dilate 5 erode 5