For practical purposes it probably is a religious test. Leave it
blank and you probably can't get elected, or re-elected. I would be
curious whether there are any unaffiliated legislators in any of the
states where this is practiced - I doubt it. If the intent or the
effect is that this is a religious test for public office, it is
actionable by any complainant who would step forward, but first that
violation has to happen.
And it shouldn't matter that it's state vs. federal, as the constitution applies down to all levels of government, as established by some Supreme Court ruling(s) in the past. In Estes Park, CO, Councilman David Habecker was recalled from office because he wouldn't stand to recite the religious pledge. In this case, another council member took it upon herself to circulate a petition for a special election to recall him from office, which was exactly what happened. Last I heard, he lost the case and it is on appeal.