In The Story of Language by Mario Pei, he gives a number of pointers for various languages that can allow you to identify the language of a text using a quick visual scan. There are certain distinguishing features for each one. For example, double accents are unique to Hungarian. Of course, he only covered the more familiar languages of the world. For really abstruse ones like in the OP you need more specialized acquaintance to pinpoint them. But a quick glance told me instantly that this example was from some region of Italy, and I have enough familiarity with Italian regional idioms to recognize it as obviously Southern Italian. My first thought was Neapolitan, but I wasn’t very far off.
Japanese text is easy to tell apart from Chinese at a glance, even if you can’t understand a single character. Japanese has a very frequent occurrence of syllabic glyphs belonging to the hiragana and katakana character sets. Kana are much simpler in form than most Chinese characters. Japanese has a lot of them, while they’re absent in Chinese.
For languages written in the Arabic alphabet, remember that Arabic, being the original user of this alphabet, has fewer letters. Other languages adapted it by creating additional letters to cover their sounds that don’t exist in Arabic. Persian has 4 additional letters. Pashto, Sindhi, and Urdu have a lot more, and a different character set for each language. Although to recognize them does require a more fine-grained acquaintance with the various features. If you already know some Arabic, the differences will jump out at you immediately, but the catch is you have to know some Arabic first.
In general, I would start by first identifying the language family, and then picking out more specific clues that distinguish languages within the family, and gradually narrow it down. As much as possible, develop a wide knowledge base by learning to recognize the specific identifying features of each language.
My favorite method for identifying the language of a written text, in conjunction with the above principles, is to search sample words in Google, and you can almost always get useful clues that way. Sometimes a search hit will even name the language outright. It helps to pick out the words or phrasings that seem less frequent, and hence more peculiar to the specific language.
If I want to identify the ethnicity of someone’s name, I search for it as a keyword in the Library of Congress database, and often it comes up in connection with a specific language or culture. Context usually provides a wealth of information. It’s all about context.