Check your connections as the others have mentioned.Check battery cable where they attach to the battery.Then follow the ground wire to where it connects to the frame and then the engine block. Look for rusty/corroded connections. Then follow the +(positive side) battery cables looking for corroded connections also.

Are you sure the alternator is charging correctly? Please check the grey terminal block shown in the 2nd picture you posted(the one with the red and green colored jumpers) they are fuse links.They feed power to lights and other circuits. Had similar problem with lights failing to work at times, the terminals were corroded at the fuse links. Do you have voltage meter and can use it? If so it will aid you greatly.

The key to finding your trouble is finding the common thread. You are having light(both interior and exterior) and engine electrical issues. Therefore you probably have a battery/bad ground/alternator/main power distribution problem. Ask and maybe someone can send you a link or a email you the pages from a FSM for your year/model with wiring diagram. For these types of problems the wiring diagram is you best friend
Good luck......hope this helps


1987 Raider/Silver/5speed/AC/Off road package
356K miles/owned since new/daily driver