An entity autocomplete widget with opportunity to save its text content There is the standard insert or edit node form with an entity_reference field and the EntityReferenceAutocomplete widget.

The client needs to save string values inputed to the widget in case of entity wasn't selected from the autocomplete list. That is, client needs to have possibility to select entity from the autocomplete list or input string value if, for example, entity is absent in the list. And new entity shouldn't be created in this case. 

I'm thinking how to create this opportunity the best way. And I'm little bit confused.

Is it possible to perform it with alter hooks only and without creating new field widget ?

Or otherwise is it possible to do it creating a new field widget having inherited it from the class EntityReferenceAutocompleteWidget ?

Or maybe the single solution for it is creating a custom widget based on TextField with including autocomplete function manually ?

Has anyone encountered with a simular task ?
There is no need to create a custom table or a second field. While editing your entity reference field, in the "Reference type" section, you could check the "Create referenced entities if they don't already exist" option. If for instance, your field is referencing taxonomy terms, a new term for the referenced vocabulaty will be created. I hope that this helps.