If you use the GUI, you don't need anything special, but you need at least the patch 8.2.0851. Remove all of your code, except the mappings:
inoremap <M-h> <left>
inoremap <M-j> <down>
inoremap <M-k> <up>
inoremap <M-l> <right>
If you use Vim in a terminal which supports the modifyOtherKeys feature (typically ...