In first order logic: P(x) is has a free variable - x.
∃x P(x) has no free variables, x is bound by the existential operator. This is what is normally called a closed formula or a sentence.
Sentences are a key concept in model theory as they allow for well-defined truth values. A set of sentences is called a theory; any individual sentence is a theorem. Model Theory resolves traditional logic into two separate pieces - a syntactic form with rules of deduction (so formal proofs can be established) together with an interpretation that establishes truth. (This Setup can then be generalised to an arbitrary logic/grammar/theory with an interpretation).
Kant is NOT talking about formal mathematical logic. Existence and attribute is much more than the syntax embodied by a formal language. Generally speaking truth values are asserted in a model that interprets this formal language. This is where perhaps where ideas of existence and attributes may fit in with classical model theory. In your example you're implicitly interpreting the formal language into the English language. You still have the problem of extracting what is exactly meant by attribute and existence. Phrasing it in formal logic doesn't change matters.
IN FACT, even in traditional model theory this act of interpretation still occurs outside of the model-theoretic framework elaborated above. That is phrasing the debate in first order logic or model theory is a red herring. It adds nothing essential to the debate. Mathematical logic and model theory are interesting for altogether different reasons.
I'm by no means an expert in this area - but it seems that Kant is referring to substance theory. Note in particular this
One natural response to the question of what distinguishes substances from properties is that properties depend for their existence on substances, for they are properties of objects (that is, of individual substances), but that substances do not similarly depend on properties for their existence.
The idea of Substance goes back to Aristotle. In his Categories he says:
A substance—that which is called a substance most strictly, primarily, and most of all—is that which is neither said of a subject nor in a subject, e.g. the individual man or the individual horse.
Additionally, in his Physics he argues that material change is accidental, it is varying form - there is an underlying substance (that must be thought together with form). Today we would call that matter-energy.
It is starting from here that one begins to think about attributes - that is predicates, and existence. Is a substance defined by all of its attributes? Is there a bare substance devoid of any attributes? Etc. There is a long development that then goes through both Western Philosophy/Christian Theology.
Spinoza for example said that God was the only Substance with an infinite number of modes - one being mental the other extension. This reconciles Descartes dualism, and asserts that existence of the mental & extension is contingent - that is on God. This has many parallels with Occasionalism a doctrine of the Ash'arite school of Islamic Philosophy/Theology, particularly developed by Al-Ghazali.
Hume being a radical empiricist denied the reality of substances - it cannot be perceived.
For an alternative understanding of this long development, one could turn towards Buddhism, especially in Nagarjunas formulation. Here the idea of substance as begun by Aristotle is rejected in its entirety. Existence, in the Western sense, they would argue has no meaning - 'the essenceless of no essence'.
So, In SHORT, I think you've misunderstood Ayer. His 'thing' should be substance. Kant is pointing this distinction out because he is contra Hume who explicitly denies the existence of substances but believes in attributes.
I think one should note that in the short extract that you've given Ayer shortcuts Kants reasoning - assenting to Kants 'existence is not an attribute' does not mean that one covertly assigns an existence to a substance once one asserts an attribute. Looking over The SEPs entry on Substance one sees that:
Kant drops the empirical psychology [of Hume] and makes it a matter of a priori psychology, that only by employing certain categories could we have experience as of a physical world. It is only by understanding the world as possessing enduring spatio-temporal objects, which enter into causal relations with each other (that is, it is only by applying the categories of substance and causation) that we can have intelligible experience. Substances—that is, a framework of stable, enduring objects—are essential, but the source of this necessity lies not how the world is in itself, but in the framework which we are obliged to impose.
That is he believes existence of substances to be phenomenal rather than noumenal.