Lemma. Let $X$ be a variety over $k$. Then $X$ is proper if and only if for every smooth proper curve $C$ and every $U \subseteq C$ open, any morphism $f \colon U \to X$ can be extended to a map $C \to X$.
Proof. We extend one point at a time. Suppose $P \in C\setminus U$, and let $V = \operatorname{Spec} B$ be an affine open neighbourhood of $P$. Let $\eta \in C$ be the generic point; note that it is contained in any open. Restricting $f$ to the generic point gives a map
$$\operatorname{Spec} \kappa(\eta) \to U \to X.$$
By the valuative criterion, we can extend uniquely to a map $g \colon \operatorname{Spec} \mathcal O_{C,P} \to X$. Let $W = \operatorname{Spec} A$ be an affine open neighbourhood of $g(P)$ in $X$. Then $g(\eta) \in W$ as well, since open sets are stable under generisation. Thus, $g$ is given by a ring homomorphism
$$A \to \mathcal O_{C,P} = B_{\mathfrak m_P}.$$
Since $A$ is of finite type, we can collect denominators to get a map $A \to B_f$ for some $f \in B$; that is, we get a morphism
$$h \colon D(f) \to X.$$
For every $Q \in U \cap V$, the valuative criterion of separatedness shows that the maps
$$h, f \colon \operatorname{Spec} \mathcal O_{C,Q} \to X$$
agree (since their restrictions to $\operatorname{Spec} \kappa(\eta)$ agree by definition of $g$). Then a simple algebra argument shows that $f = h$ on $U \cap V$. Thus, they glue to a well-defined map on $C \cup \{P\}$.
Conversely, if $X$ is proper, and $f \colon U \to X$ is a map, let $C'$ be the scheme-theoretic image. If $C'$ is a point, then $f$ is constant, so we can trivially extend. Otherwise, $C'$ is a proper curve (being closed inside a proper). Then the normalisation of $C'$ is isomorphic to $C$, since there is only one smooth proper curve with a given function field. Thus, the normalisation map $C \to C'$ extends $f$. $\square$
Remark. For a slightly more high-brow version of the same proof, see this blog post.
Remark. To see the analogy with the punctured disk, note that if we identify all nonzero points of the complex unit disk $\Delta$, we get a topological space with two points: one closed point (the image of the origin), and one non-closed point (the image of the punctured disk $\Delta^*$). Thus, removing the origin from this quotient space also gives a one-point space.
Of course, topological spaces behave very differently from ringed spaces, so to some extent the analogy ends there.
In another direction, if we equip $\Delta$ with the sheaf of rings of holomorphic functions, then the local ring $\mathcal O_{\Delta, 0}$ is the ring of convergent power series $\mathbb C\{x\}$. This looks a lot like the localisation $\mathbb C[x]_{(x)}$; for example the completion of both rings is the ring of power series $\mathbb C[[x]]$. This is the beginning of Serre's GAGA principle.
The analogy between the punctured disk and the function field of a curve does not end there. For example, the fundamental group of $\Delta^*$ is $\mathbb Z$, with covers given by $\Delta^* \to \Delta^*$, $x \mapsto x^n$. The absolute Galois group of $\mathbb C((x))$ is the profinite completion $\hat{\mathbb Z}$ of $\mathbb Z$, with extensions given by $\mathbb C ((x^{\frac{1}{n}}))$. This is no coincidence (the key word here is étale fundamental group).
Best Answer
In the valuative criterion, you need a morphism $\mathrm{Spec}(R)\to Y$. In the affine $Y$ case, this means $R$ must be an $A$-algebra.
Write $\mathbb P^n_A=\mathrm{Proj}A[T_0, \dots, T_n]$. A rational point $x\in \mathbb P^n_A(K)$ can be represented by homogeneous coordinates $(t_0, t_1, \dots, t_n)$ with $t_i\in K$ and at least one of them is non-zero. Multiplying them by a suitable element of $R$, which does not change the point $x$, one can suppose that all $t_i\in R$ and at least one of them, say $t_0$, belongs to $R^*$ (units of $R$).
Consider the morphism $\bar{x} : \mathrm{Spec}(R)\to D_+(T_0)\subset \mathbb P^n_A$ defined by $$ O(D_+(T_0)) = A\left[\frac{T_1}{T_0}, \dots, \frac{T_n}{T_0}\right]\to R, \quad \frac{T_i}{T_0}\mapsto \frac{t_i}{t_0}.$$ Then it is easy to see that $\bar{x}$ extends $x$.
The uniqueness of the extension comes from the fact that the projective space is separated. One can also check directly as above using coordinates (if $\bar{x}'$ is another extension, suppose for instance that it maps the closed point to some point of $D_+(T_0)$, then show that $t_i/t_0\in R$ and $\bar{x}'=\bar{x}$.)