How do I execute code before update the content?
I use the Hook Post Action module because it's execute after the action. So you know that the node is really updated.

So this module introduces several new Drupal hooks to overcome this
limitation

hook_entity_postsave
hook_entity_postinsert
hook_entity_postupdate
hook_entity_postdelete
hook_node_postsave
hook_node_postinsert
hook_node_postupdate
hook_node_postdelete


But, if you want you can use the hook_node_update.
To show info in the node page you can use the EVA module.

&quot;Eva&quot; is short for &quot;Entity Views Attachment;&quot; it provides a Views
display plugin that allows the output of a View to be attached to the
content of any Drupal entity. The body of a node or comment, the
profile of a user account, or the listing page for a Taxonomy term are
all examples of entity content.