Module for creating "entity edit" form? Is there a module that will take an entity machine name and optionally id as input, and generate a suitable edit form as output?
If you want to create or edit a reference entity in a node add/edit form then you can use Entity Connect module. 

If you want to have a separate page which will take an entity machine name and optionally id as input then you can have a look at the code in this module and build on that. 

You may also take a look at Inline entity Form