I'm not sure how this varies from country to country, but in Germany honking is considered a warning signal (similar to hazard lights, but more direct) and intended to be used as such.
Of course most drivers are still primarily using it to vent their aggressions, but doing that is abusive and can result in a fine.
What would complicate automated honking, however, is that the specifics are likely different from legislation to legislation.