Well, game mechanics basically make sure that command blocks cannot be placed in survival, so your best chance is to use a function/ a bunch of commands, which will have to track the furthest air block in the player's line of sight within a radius of ~5 and then detect a right click of something (most likely a carrot on a stick) to then execute a command placing that specific block there. Note that you'll have to do this for every single custom blocks if you really want it to be like placing a block.
Either that or just use armor stands with data instead of spawn eggs since that won't meddle with any of the spawner stuff. Whichever one tickles your fancy.
You could place a block (example crafting table) down in the position you want the block to be and then throw (drop) a command block on top on it with 'Q' and then you could execute a command to test for a dropped command block item on top of a crafting table and replace the crafting table with the item you wish.
This would also work for multiple different custom blocks if you used different place holders below the dropped command block