A task in a shared build script (and that task needs external dependencies) can't resolve its dependencies

It’s a known limitation. The ‘buildscript’ block needs to go into the build script that applies the script plugin (or at least into the root project’s build script).