It seems like there are a few broad categories of fish, and I can easily substitute any fish of a given category for any other most of the time. The one I'm most familiar with is whitefish: a recipe for cod comes out just as well with halibut or tilapia. Are there other such categories? What are they?
Oh yes. Different people use different categories, no one system is canon, but this bit from Cooking Light is helpful; I wouldn't hesitate to substitute within these categories.
You mention that you have successfully substituted halibut or tilapia for cod. This list puts tilapia in a different category than the other two. That illustrates that fish species substitution is a fuzzy thing, and a cook shouldn't feel bound by any list. Even within categories, any change in the choice of fish is going to change the final taste of the dish, either slightly or dramatically. That isn't necessarily a bad thing, in fact it can be a very good thing.
Just as an aside, sustainability is a very good reason to substitute one species within a category for another. In the US these are to good sites to help choose a species: Monterey Bay Aquarium; NOAA If anyone knows of good sites that provide good information about other parts of the world, please leave a comment.