Break off tamarind from brick and soak in 1/3 cup warm water 30 minutes, then push through a sieve and discard solids.
Heat oil in a large, heavy-bottomed pot and fry shallots, gently stirring, until golden and crisp, about 12 minutes. Drain on paper towels. Pour all but about 2 tsp. oil into a heatproof bowl (reserve for another use).
Cook garlic in pot over medium heat, stirring, 20 seconds. Add chili paste, broth, 1 cup water, the fish sauce, sugar, tamarind liquid, and tomatoes; bring to a boil, covered.
Simmer, uncovered, 5 minutes. Add cabbage, pineapple, bean sprouts, and shrimp; cook just until shrimp curl. Stir in herbs and chiles; serve with shallots and lime wedges.
*Find tamarind pulp and sambal oelek in the Asian aisle of well-stocked grocery stores or at Asian markets.
Note: Nutritional analysis is per serving.