The script throws exceptions when cancelled or when there's no matches.
The catch block displays the message and restores the cursor position.
The finally block restores buffer properties.
Having &scrolloff > 0 caused an issue where backwards searches would
scroll during the searchpos() call and hide parts of the buffer. This
fix temporarily sets scrolloff to 0 during function execution.