You wrote:
In that sense, I don't think the definition for metric space covers real-valued functions. (Isolated points)
If you are asking what metric you should take on $\mathbb R\cup\{\pm\infty\}$ so that the definition for metric spaces yields the correct definition for real function, then the answer is: Identify $\mathbb R\cup\{\pm\infty\}$ with $[0,1]$ via some order-preserving bijection. Transfer the metric from $[0,1]$ to $\mathbb R\cup\{\pm\infty\}$ using this bijection. Then the definition given in Wikipedia article for function to an ordered metric space gives as a special case the definition for functions to $\overline{\mathbb R}$.
Here is link to the current revision of the Wikipedia article linked above. (Just in case it changes substantially in the future.)
EDIT: (In response to the comment asking about $\limsup\limits_{x\to\infty} f(x)$ for a function from $\mathbb R$ to $\mathbb R$.)
$\limsup_{x\to a} f(x)$ is defined even if the value of $f$ at the point $a$ is not defined. If we follow the definition from Wikipedia, we should look at punctured neighborhood of $\infty$. The balls around $\infty$ are the intervals of the form $(x,\infty)$. So we get
$$\limsup\limits_{x\to\infty} f(x) = \lim\limits_{x\to\infty} \sup\{f(a); a>x\} = \inf\limits_{x\in\mathbb R} \sup\{f(a); a>x\}.$$