As in the title I was wondering if this very simple approach is correct or not, in general.
I am adopting the definition of affine variety as the zero locus of systems of polynomials.
For instance consider $$X=\{(x,y)\in\mathbb{R}^2|y>0\}$$
To prove that this is not an affine variety I would observe that if it was, it would be closed in the Zariski topology on $\mathbb{R}^2$, and hence in the Euclidean one, which is stronger being any polynomial a continuous fucntion. And this is clearly false.
What makes me wonder is that for instance I could apply the same resoning to $\mathbb{A}^2\setminus\{0,0\}$, where $\mathbb{A}^2$ is now the affine space on $K=\mathbb{C}$. Anyhow, the standard proof that the punctured plane is not affine variety is much more complex, involving the ring of regular functions $\mathscr{O}(\mathbb{A}^2\setminus\{0,0\})$.
Hence I ask: is the approach correct at least in the first case, what about the second?
Your argument only shows that the respective variety is not a closed subvariety of affine space with respect to the inclusion that you fixed beforehand. It does not rule out the possibility that there is a different embedding into an affine space that does exhibit this variety as a closed subvariety of an affine one, which would show that it is affine.
For example, take $\mathbb A^1\setminus \{0\}$. This is an affine variety, but not a closed subvariety of $\mathbb A^1$.
Edit: I think that your source of confusion is that your definition of an affine variety is not the same as the one used by the authors that discuss the result that the punctured plane is not affine. I suspect that they define the notion of affineness in an absolute sense: Given some reasonable definition of an algebraic variety (e.g. via scheme theory or in the style of André Weil), affineness then becomes a property of such a variety. In your definition, on the other hand, being an affine variety is a property of a pair $(S, \mathbb A^n)$ where $S$ is a subset of $\mathbb A^n$.