hidden away is a lua function - vlc.playlist.move()
I assumed this was all I needed to re-order a playlist, but it's broken.
If I move the playlist around too much with this function, it eventually crashes, as described in this bug report from over 4 years ago:
https://trac.videolan.org/vlc/ticket/17048
I've tested it on 3.0.8 and 3.0.9, the latest 4.0.0 builds don't even run so I can't test it.
Is VLC dead? I'm beginning to think so.
If anyone knows of another way of moving playlist items in LUA let me know.