Hello Menno,
Assuming that your users need to press enter to submit the value in the grid, adding a KeyUp event through the HTML snippet might be an option, you can then check if Enter was pressed and if the currently focused element is a child of your grid.
Afterwards you can refocus on a parent object, say something like ... document.activeElement.parentElement.focus();
It's a bit of a stretch as Mendix might still disperse the focus but I think it's worth a try.
Hope this helps.