The section of https://developer.www.ads-software.com/reference/functions/antispambot/ which says, “To use this in your WordPress Content area all you have to do it wrap it in a short code. [email][email protected][/email]
” is referring to code example above it.
You will need to first apply the code under “Example” by making your own plugin, adding it to theme functions, or adding it to a code snippets plugin before you can use the email shortcode described below that.
If you had added to Twenty Twenty-Four’s theme functions file without creating a child theme first, then yes updating the theme would have replaced that, since theme updates replace all theme files.
I recommend using a code snippets plugin instead like https://www.ads-software.com/plugins/code-snippets/ to use the example code instead, or just use a plugin specifically made for what you want https://www.ads-software.com/plugins/search/obfuscate+email/ or a more traditional contact form: https://www.ads-software.com/plugins/search/contact+form/