You can actually detect whether or not the current project *has* a PlayProject.dist setting defined. That's a bit spiffier.
So, you'll have to deconstruct the distUnzipTask.
(PlayProject.dist.?? zip (foo, bar, baz)) apply {
case (None, _) => // Not a play project, return an empty task.
case (Some(dist), (foo, bar, baz)) =>
// Here's where it gets funky, maybe mark can help here? I'm writing this off the cuff, and I can dig in to give you exact syntax if needed.
Task(myImplementation(foo,bar,baz)) dependOn dist
}
Note: I highly recommend, when defining tasks, to have a pure function which implements them in addition to/rather than a single member which initializes them. This way, you have more flexibility in how you wire things together, as do your users.