Hello !
For the globalvideomode, i think it's already on defaut, which is fine.
it will use whatever resolution you have forced in the config.txt, in this case DMT 87, the custom resolution you choose above.

in the case you want to be more clear in the config :

global.videomode=DMT 87 HDMI system.es.videomode=CEA 6 HDMI

(because emulationstation will be too small in 320 240, you need 640 x 480 interlaced)

for the resolution i dont use 320 x 240, but 1920 x 240, (1920 can fit a lot more emulator with original resolution.)

this is my config.txt :

hdmi_cvt=1920 240 60 1 1 0 0
hdmi_ignore_edid=0xa5000080
hdmi_pixel_encoding=2
avoid_safe_mode=1
disable_overscan=0
config_hdmi_boost=4
hdmi_drive=2
hdmi_group=1
hdmi_mode=6
hdmi_force=1

kernel=zImage

After that, you have to create a config file in the retroarch folder, like this for each emulator :

nes.cfg
aspect_ratio_index = "22"
custom_viewport_width = "1792"
custom_viewport_height = "240"
custom_viewport_x = "63"
custom_viewport_y = "16"

which define the exact viewport for the emulator.

Sorry for my english, tell me if you need more info 😉