I wouldn't stick Dune solely in the second category. It has a great deal of social commentary, and touches on a number of environmental and ethical issues. Herbert simply went to great lengths to create an extremely detailed world in which to present these ideas.
I think Stephenson's Anathem is a better example of the second category. It's almost purely world-building escapist fiction. There's not any obvious message apart from perhaps a satirical introspective of our own society.
I'm a bit shocked at your statement that there's no message in Anathem. The message I got out of it is to question my assumptions about the flow of history, most specifically about things that "everyone knows are true". For instance, why doesn't everyone know that you have to plan projects in certain ways if you expect them to get done at a certain time? Well, in part because the idea of getting done at a certain time is new to this half century (which is a small amount of time in history) and because the idea of project planning is about as young. Even now those ideas are getting disrupted too by other things that everyone's suppose to know are true.
Basically Anathem introduced me to the historical progression of ideas and the constant forgetfulness of that process as its practiced by at least Western society. You can make the argument that academics know that this isn't the case, but I'm not sure that they're not caught up in the same progressive forgetfulness as the "common person".