So, there are some glitches to make omxplayer loop with a script on a Raspberry Pi. When the script loops a very short file, it starts to crash quite quickly. I want to reproduce these errors and look for a solution later.
One potential solution was to make the files being played bigger. So I looked for some commandline magic of glueing the same file to a copy of itself. This mencoder code looks for all mp4 files and sticks them together.
$ mencoder -oac pcm -ovc copy -o merged_file.mp4 `ls *.mp4`