Your first and last points can be trivially achieved by mapping those keys via xmodmap - for instance:
! keycodes of your right and left alt keys
keycode 108 = Mode_switch
keycode 64 = Mode_switch
! remap the i key to emit Up when pressing Alt+i
keysym i = i I Up Up
You can use the 'xev' utility to quickly find out the keycodes of keys on your system (just hover the window, press your button, and read the keycode). But all that is only necessary if your desktop environment doesn't ship with key mapping functionality already.If you're on wayland instead of Xorg, then you'll have to use xkb to set this up.
There's also a bunch of AutoHotkey-like tools, but they're probably not necessary for something as simple as you're describing. The first that come to mind are AutoKey, SikuliX and IronAHK (a cross-platform rewrite of AutoHotkey, but I think it's discontinued).
Most desktop environments ship with functionality to (at least) run a command when you press a certain key. Others, like AwesomeWM, are way more powerful.