It turns out that you can actually nest hooks like this:
before('deploy:cold') do
before('deploy:migrate', createdb)
end
which answers my question exactly. But keep in mind that you actually want to hook createdb in a different spot rather than at deploy:migrate.