Using Jenkins declarative when conditions in scripted pipelines
It would seem not - in the scripted pipeline, groovy needs to be used - see the docs

node {
    stage('Example') {
        if (env.BRANCH_NAME == 'master') {
            echo 'I only execute on the master branch'
        } else {
            echo 'I execute elsewhere'
        }
    }
}



(taken straight from the docs)

This would be the same as when { branch 'master' }