I hope I'm answering the right question. Your title says "grainy" but then the rest of the question talks about "gloopy". If the problem really is grainy, I think the issue may be that you are using better cheese than in the past. Well aged cheeses tend to get a little bit drier and crystalline, and then they don't seem to melt as well. I've had grainy in that case too. Sometimes I'm happy to live with a little bit of the graininess to get the better flavor.
I'm not sure that's the right way to go about this. There are tons and tons of types of cheeses. I'm not sure you'll find a good list of all substitutes because it will be too big to put together.
Instead, I think you need to learn about the types of cheese so that you can make an informed decision. Is a cheese blue, sharp, creamy, hard, soft? How does it melt? What part of the world is it from? Those questions will allow you to find a cheese that is similar enough to make a good substitution.
For instance, if a recipe called for Pecorino a hard Italian cheese, Parmesan (another hard Italian cheese) would make a much better substitute than goat cheese or cheddar.
So see what cheeses are available at your local store. Write down the whole list (and preferably buy some of each). Get home and do a little bit of research on each one. Where is it from? How do people describe it? Take some notes on all of this. Then, when you see a new cheese in a recipe, look it up and see how it's described. Then find a cheese from a similar area with similar characteristics, and you should be good to go.
Edit: While I stand by my approach as a great way to go about this, I did find a good resource. Cook's Thesaurus has a great list of cheeses, including substitutes, broken down by type of cheese, type of milk, hardness, etc.
Best Answer
Cheap cheese is, as others have explained, cheap for a reason.
You should be able to find old/extra old (AKA "sharp"/"extra sharp") cheddar cheese in the cheap section, which makes a reasonably good starting point - this cheese does have some flavour.
Daniel says he simmers the milk; I generally start with evaporated milk, which is even more economical than regular milk and keeps in the pantry forever. Although I would not use evaporated milk in just any recipe calling for milk, it happens to work quite well for Mac 'n Cheese.
Other common additions to help offset the lack of flavour in poorly-aged cheeses are:
Salt. Remember, salt is essentially a flavour enhancer and will bring out the natural taste of any other ingredient.
Mustard. Prepared mustard is OK, but concentrated mustard made from dry mustard and a small amount of water is even better, so you can avoid having to add too much liquid. This doesn't enhance the flavour of the cheese, but it does share some of the "sharpness" associated with cheddar and makes a good complement. As a bonus, it also acts as a natural emulsifier for the sauce, helping to minimize separation and curdling.
Ground cayenne or red pepper. Although most people probably don't associate Mac 'n Cheese with piquant, a small amount of this won't make the sauce noticeably spicy, but it will add a bit of the same "kick" you get with very old cheese.
If all else fails, my "secret weapon" for Mac 'n Cheese is - not kidding - the sauce base from Kraft Dinner (AKA Kraft Macaroni and Cheese Dinner for you Yankees), especially if you can get the "extra sharp" version. This stuff is dirt cheap (often just 99 cents for a package) and before you dismiss this as heresy, keep in mind that the idea is not to use the whole thing. Just a teaspoon or two to enhance your homemade sauce. If you don't approve of such shortcuts then you shouldn't be buying cheap cheese in the first place, right?
So there you have it. Try some or all of the above; I'm sure you'll end up with something that's at least acceptable, if not great.