Hello Ricardo,
Some times edit button might be subject of Workflow and your code will be overridden by workflow. The better place to write a overwrite exit would be /SAPSRM/CL_PDO_META_BO_SC method /SAPSRM/IF_PDO_META_CONSUMER~GET_ACTION_METADATA and you could check the field iv_action specifically for "EDIT" and set the visibility to false.
Thanks and Regards,
Veera