There is something exemplary of Islam, particularly the Sufi Mystic tradition, in this text. The story, a kind of quest narrative with an unceertain object of the quest, is structured by allegory.
The disease with which the story begins seems quite allegorical--finding the cure elusive, challenging, arduous, but in the search there seems as many rewards as in the attainment.
Now, If Zaabalawi is an allegorical figure, what is he a figure for. Not god--that is too simple here, but perhaps the vehicle through which god may be discovered, acknowledged, found, as the mystic tradition would have it, within one's self.
Along the way to acknowledging what might encompass the proper search for divinity, Mahfouz comments upon his society at the same time. Thus we see, in the route taken by our hero, a kind of road map of gradually more sacred spaces.