Just a quick update:
The script should work, but the entire /etc/docker folder actually only gets created when the docker service is started, so the script also has to make the directory before copying the file.
(I also realized that this entire approach doesn't really work for my use case at the moment because I have Loki running in a dedicated network to which the unRaid host doesn't have access (I'm aware of the setting to enable it, but that is broken and the workaround is a little to sketchy for my taste), so I'll try to work with a different logging solution. )