Define task or group once and use multiple times with DSL?

When defining a release from a Groovy-based DSL script, is it possible to define a task or a group of tasks once and have that same task/group in multiple places in the release (without copy/pasting the tasks {} block)? I have a use case where I need to execute the exact same group of tasks, once early in the release, and once later, and don’t want to duplicate the task definitions.