Entity create access based on a custom field
Use the rules module instead? https://www.drupal.org/project/rules 


Before saving entity of type X
Entity has field Y
Entity field Y is Z
Allow, else deny