My '98 trooper would do something similar to this. It never stranded me, though. I didnt check the codes, but i would get the flashing check engine, loss of power etc. ironically it always happened in the hills, but usually while pulling a load, and always after driving a good while in warm/hot weather. I would unhook the negative battery cable later for a second opinion, clear everything out, and it would not happen again for a long while- like months. I always diagnosed it myself as false signals from the oxygen sensors as well.