Pour the milk into a large saucepan with the salt, cayenne pepper, and black pepper, and bring to a boil over medium heat, stirring constantly to prevent scorching. Sprinkle in the grits, cover, and simmer for 20 to 25 minutes, stirring occasionally until thickened.
Uncover the grits, and add 1 1/2 cups of shredded Cheddar cheese and the hot pepper sauce, beating the mixture with a spoon until the cheese melts and the mixture is smooth. Cover the cheese grits and set them aside to firm up.
Heat the olive oil in a saucepan over medium heat, and cook and stir the onion and garlic for about 5 minutes, until the onion is translucent. Add the shrimp, and toss them in the hot oil for about 3 minutes, until the shrimp just turn pink and opaque. Stir in the garlic powder and diced tomatoes with chile peppers, and set the shrimp mixture aside.
Preheat oven to 350 degrees F (175 degrees C), and spray a 7x11-inch baking dish with cooking spray. Place about 1 cup of shrimp mixture in the bottom of the dish, followed by 1 cup of cheese grits in a layer. Continue layering shrimp and grits, and top the final layer with 1 cup Cheddar cheese.
Bake in the preheated oven for 30 minutes, until the cheese topping is bubbling and beginning to brown. Let the casserole set for about 10 minutes before serving.