ScriptRunner allows you to respond to Bitbucket events, via an inline script or pointer to a file. You can view the full list of events here.
You could respond to events, for example in order to:
ensure a Jira project exists for a corresponding Bitbucket project
send mail when a repository is forked
set up Continuous Integration for new repositories
Some events in Bitbucket are cancelable - you can cancel an event in order to prevent a user:
creating a project
forking a project
Find the list of cancelable events here.