Pour oil into a 10- to 12-inch frying pan over medium heat. When oil is hot, add onion and garlic and stir frequently until onion is limp, about 5 minutes. Add tomatoes, hot sauce, basil, thyme, salt, and pepper. Stir occasionally until tomatoes are soft, about 5 minutes.
Meanwhile, peel potatoes and slice 1/8 inch thick. In a 9- by 13-inch baking pan, layer about a third of the tomato mixture, followed by half the potatoes and half the cheese. Repeat layers, ending with tomatoes. Cover tightly with foil.
Bake in a 400° regular or convection oven until potatoes are tender when pierced, 40 to 50 minutes. Uncover and bake until browned on top and bubbling around the edges, 20 to 25 minutes longer.