Here's how you do this automatically after keeping your cursor still for a short time:
:au CursorHold * :exec 'match Search /\V\<' . expand('<cword>') . '\>/'
By default, this will highlight the word under the cursor after 4s of inactivity. Use :set updatetime=100
to make it happen after 0.1s instead.
If you want to do this in a script instead of as a one-off, put it in an autogroup so that you don't add a new CursorHold
autocommand every time the script runs:
augroup highlight_current_worldhighlight_current_word
au!
au CursorHold * :exec 'match Search /\V\<' . expand('<cword>') . '\>/'
augroup END