I've figured it out. Probably a hacky way round but still.
I enabled 'Template Authoring Mode' and grabbed the docker command, then update the xml to keep it in line with the docker command that will be run.
...
if [ "$oldport" != "$gluetunport" ]; then
docker stop qbitorrent
docker rm qbitorrent
sed -i 's/${oldport}/${gluetunport}/g' my-qbittorrent.xml
/usr/local/emhttp/plugins/dynamix.docker.manager/scripts/docker create --name='qbittorrent' ....
fi
...
Maybe this will help someone in the future.