To make editing more intuitive, delete and rename options to be shown in right click context menu.
Update:
Right click context menu opens 'Delete' option for all blocks and also 'Rename' option in case of a few Basic blocks.

But the edit functionality is not yet implemented for Code block.

Edit option would need to be able modify the input, output and parameter options. Best way would be reuse the creation popup while prefilling existing data.