Add a few improvements and fixes to the state.event shell script example
Merge pull request #18204 from whiteinge/doc-state.event-sh-ex

Add a few improvements and fixes to the state.event shell script example