As a potential solution to dokku/dokku#425, I think it would make sense for pluginhook to inject an environment variable that scripts can check for to see if they were triggered by a pluginhook call, and what the trigger was.
For example, the solution to the mentioned issue would be to check for RUNNING_PLUGINHOOK=pre-release and just not trigger the restart code in config:set if true.