Restrict the conditions under which a location can be edited

A location can be edited if:

It has never been used for an event, OR
The logged-in user is an admin, OR
The logged-in user is an organizer of an event using that location, PROVIDED:
  It has been used for a published event and the user is an organizer for one of those events, OR
  It has never been used for a published event and the user is an organizer for one of the unpublished events.