The word "has" is not used only for questions. It is also used to create the present perfect tense. Like, "He has read the book."
The sentence you give uses an unusual word order. The more common word order would be, "He has not spent all his time in these parts for nothing." I think the writer in this case varied the word order because he wanted to use the phrase "not for nothing".
In a question, the "question word" normally comes first. If this was a question, we would say, "Has he spent all this time in these parts for nothing?" or "Has he not spent all his time in these parts for nothing?" (Trying to put "not for nothing" into a question makes for awkward wording. I'd probably drop the "not" and state the question the other way like my first example. Depends what you're trying to say, of course.)
If you say, "I did all this work for nothing", that means that it turned out to be a waste of time. Nothing of value resulted from it. So if you say it was "not for nothing", that means that it was NOT a waste of time. Something of value did result from it.