أَنَّهُ يَلْزَمُ الْأَدِيبَ الْأَرِيبَ إِذَا دَخَلَ الْبَلَدَ الْغَرِيبَ أَنْ يَسْتَمِيلَ قَاضِيَهُ وَيَسْتَخْلِصَ مُرَاضِيَهُ
A shrewd man of letters should win the judge’s goodwill when arriving in an unfamiliar town.
Adīb / arīb / gharīb create an audible pattern. In the tale’s social setting, a traveller may need the protection or assistance of a recognized authority.
This is counsel within the story’s historical world, not a universal instruction to cultivate judges in every modern setting.
فَاتَّخَذْتُ هَذَا الْأَدَبَ إِمَامًا
He adopted this counsel as a guide; imām is figurative for a guiding principle.