Create a bookmark and paste this code:
javascript:document.addEventListener('keydown', (e) => { if(e.altKey) { const child = e.key === 'ArrowLeft' ? 2 : e.key === 'ArrowRight' ? 3 : 0; child && document.querySelector(`.h0>:nth-child(${child})`).click(); } });
Now when you go to gmailGmail, you can activate the keyboard shortcut by clicking on the bookmark. Use option-left or option-right on Mac (altAlt-left or altAlt-right on Windows) to go to the message before or after.
I didn't test this 100%, so YMMV.