Even if we can't have a definitive solution, I believe we can find a plausible candidate.
As the OP mentioned, various pieces of evidence are scattered through the story. Possibly the most significant is that the currency used is the shilling. This at once cuts down the number of possible countries dramatically: only four countries currently use the shilling: "Kenya, Tanzania, Uganda, Somalia, as well as the de facto country of Somaliland".
When the shopkeeper, Hamid, goes walking at night he is struck by the peacefulness of the streets. I think that is grounds enough to exclude Somalia and Somaliland straightaway. The city is also a seaport. Uganda has no coastline, so we are left with Tanzania and Kenya.
As Gurnah is originally from Tanzania, it is tempting to assume that he would have set the story in his homeland, following the tried and trusted maxim "Write what you know". Otherwise it is hard to find a characteristic to discriminate between the two, as both being ex-colonies of the UK they share a similar history and culture, and bordering each other, they also have similar climate.
Assuming the country is Tanzania, this leaves an obvious candidate for the location. The setting is definitely a city, rather than a large town. This really eliminates Zanzibar from contention, as with a population of 220,000 it's too small. The location is also on the coast with a port, and has a prosperous area separated from poorer townships by a seasonal swamp. These characteristics all fit Dar es Salaam, Tanzania's ex-capital. An entertaining account of travelling on one of Dar es Salaam's "Dart" buses recounts passing from the prosperous areas to the slums, the Jangwani swamp acting as the boundary between the two. Interestingly Hamid notices "Buses were parked in rows" on one side of his local square - maybe he lived near this bus-route - which is another strike against Zanzibar as apparently it does not have a bus service.
In the absence of a statement from Gurnah, I think this may be the best we can do in identifying the city.