'If you are a stranger, act like one' is a Delphic Maxim that can be interpreted in many, many ways. I'm going to try to cover all the angles, but I am sure your interpretation of this maxim will be slightly different than mine, regardless. 

Traveling in ancient Hellas was not done on a whim. Most people stayed at home, or at least near their city or village, unless work or emergency called them away. The road could be a treacherous place, and the sea even more so. Family tended to stay close together, so people rarely had to travel out to visit parents or other loved ones. While there were mot certainly reasons to visit or move to other city states, a lot of people in ancient Hellas never had to, so why the maxim?

As I have written before, ancient Hellenic society was notoriously strict about who was part of it and who was not. If you were not a citizen, you were either a doûlos--slave--or a métoikos, more commonly referred to as 'metic'. All three classes had their parts to play in Classical Hellas. Métoikos were citizens of other Hellenic cities and beyond who came to Athens because of the unique opportunities the metropolis offered.

In ancient Athens, métiokos, while welcomed, were disadvantaged from the get-go. They had to register their status within a month of arrival. They had no political influence, were not entitled to governmental aid in case of emergencies, the could own no farm land or real estate unless they were given special permission by the government, and they were not allowed to procure a contract with the government to work the mines. They were, however, expected to enter the army, and pay taxes if they were wealth enough, like citizens. On top of that, they also had to pay a métoikos poll tax--the metoikon--which was twelve drachmas ($ 720,-) a year for men and six for women, as well as another special tax--xenikon telos--if they wanted to set up a stall in the market place.

Métiokos did have access to the judicial system; they could both prosecute others and be prosecuted themselves. Unlike citizens and very much like slaves, métiokos were not allowed to represent themselves; they needed a citizen to vouch for them--a sponsor, called prostates. Métiokos were entitled to take part in religious ceremony. Like slaves but unlike citizens, métiokos could be made to undergo judicial torture. The penalties for killing a métiokos were not as severe as for killing a citizen.

While citizens, métiokos and doûlos were indistinguishable in appearance and behavior, society functioned largely on their separation. Only Corinth and Athens had large populations of métoikos, but all city states had rules concerning their legal, religious, and societal status. Athens had the most lenient ones, but it was still easy for a métoikos to step out of line, and that could easily lead to a life of slavery. As such, knowing to 'act like a stranger' was a vital piece of knowledge for anyone choosing to visit or live in a city that was not the one he was born in. As such, the maxim in this regard does not so much allude to attitude, but awareness: a constant sense of knowing your place, even if you lived in a city for many years. You, as a métoikos, had a role to fulfill, and clear lines which not to cross. As such, specific behavior was asked of you, and you had to be familiar with these rules.

A second interpretation is related to xenia. Hospitality in ancient Hellenic was a complicated ritual within both the host and the guest has certain roles to fill and tasks to perform. Especially when someone unknown to the host came to the door, the ritual held great value. The host has many tasks in his process, but the guest has an important part to play as well: the guest is expected to be courteous and not be a burden to the host. The house was a sanctuary in ancient Hellas with a lot of social rules attached to it. Guests could not enter certain parts of the house, and male guests were kept away from women at all times. Long term guests had a slightly different statues, as they became part of the oikos, but they were still subject to restrictions when it came to social an religious behavior. Again, the maxim would have reminded guests to be mindful of their hosts and to be grateful to be included in the oikos of another.

The last point from ancient Hellas I want to make is religious. Métoikos and houseguests were almost always passive participants of religious rites. In the oikos, the kurios performed the rites, and in state festivals, Archons and priests performed that function. Métoikos were barred from attending a number of festivals. That said, the way Hellenic ritual structure worked, meant that even visitors of a city would recognize what was going on, and they would be able to partake of the rite fairly easily. There were undoubtedly differences between city states, but the basics were always there. This meant that rituals did not have to be adjusted for métoikos, and kharis would be preserved. In this spirit, I still call for standardization of practices within modern Hellenismos.

In a modern context, acting like a stranger, when you are one, means to be an attentive guest, to not overstay your welcome, to follow the rules of the house you are in and to ask for clarification if you are not sure what the host expects of you. It means investing time and energy into getting to know the place and people you are visiting, and to observe that this place and these people are not there to serve you: you are a guest, and as such, it is your place to follow their lead. To me, this maxim calls for modesty and attentiveness, and those are not bad virtues to foster within yourself.