it depends upon the basis for barring them. If it based on race or some other Constitutionally barred method, then Smith v. Allwright means it can't be used. But a party could protect itself from insurgent outsiders by requiring its officials and candidates to have voted in only its primary during the last eight years, or some other means of demonstrating party loyalty. In 2012 the SCGOP refused to allow Stephen Colbert to run in its presidential primary.
I agree. Given the way the Supreme Court has been tinkering with the Equal Protection Clause, the courts will concern themselves with the purpose of a candidate being excluded, not just what is the result of the exclusion.