[DOCS] Fix stored script example snippet (#83056)
Changes:
* Updates the example Painless script to be valid and aligns it with the example in [How to write a script](https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting-using.html#script-stored-scripts).
* Adds a hidden snippets to delete the script for cleanup.
Relates to https://github.com/elastic/elasticsearch/issues/83038