As explained in the question Manuel linked, the first problem is that you cannot use \makeatletter ... \makeatother in the definition of a macro.
\makeatletter
\newcommand{\test}[1]{
\setlength{\tempdimen}{\widthof{#1}}
\FPeval\resultaP(70-\strip@pt\tempdimen)/2}
}
\makeatother
In addition, you cannot \setlength a length without creating it first.
\makeatletter
\newlength\tempdimen
\newcommand{\test}[1]{
\setlength{\tempdimen}{\widthof{#1}}
\FPeval\resultaP(70-\strip@pt\tempdimen)/2}
}
\makeatother
If we are working from your code, we also need to eliminate the strange invisible characters.
\makeatletter
\newlength\tempdimen
\newcommand{\test}[1]{
\setlength{\tempdimen}{\widthof{#1}}
\FPeval\resultaP{(70-\strip@pt\tempdimen)/2}
\FPprint\resultaP
}
\makeatother
Then it works without issue. (\FPprint\resultaP added for demonstration purposes.)
However, this code will not necessarily give you the results you want. For example,
Here is an example: \test{5}.
Here is another: \test{5}--\test{7809}.
produces

because the definition of the macro tells TeX to insert spaces at various points - quite a lot of them, in fact.
To avoid this, we need
\newcommand{\test}[1]{%
\setlength{\tempdimen}{\widthof{#1}}%
\FPeval\resultaP{(70-\strip@pt\tempdimen)/2}%
\FPprint\resultaP
}
which gives the expected result

\documentclass[10pt]{article}
\usepackage{calc}
\usepackage{fp}
\makeatletter
\newlength\tempdimen
\newcommand{\test}[1]{%
\setlength{\tempdimen}{\widthof{#1}}%
\FPeval\resultaP{(70-\strip@pt\tempdimen)/2}%
\FPprint\resultaP
}
\makeatother
\begin{document}
Here is an example: \test{5}.
Here is another: \test{5}--\test{7809}.
\end{document}
As Heiko Oberdiek points out, for the minimal example, at least, \widthof is not required and calc need not be used. (In fact, I'd never heard of \widthof and have always used \settowidth so tested with that originally.)
\documentclass[10pt]{article}
\usepackage{fp}
\makeatletter
\newlength\tempdimen
\newcommand{\test}[1]{%
\settowidth\tempdimen{#1}%
\FPeval\resultaP{(70-\strip@pt\tempdimen)/2}%
\FPprint\resultaP
}
\makeatother
\begin{document}
Here is an example: \test{5}.
Here is another: \test{5}--\test{7809}.
\end{document}
There are easier packages to use than fp by now, I think. Or, at least, better documented ones.
\strip@pt? – Bernard May 22 '16 at 00:56ptfrom a dimension:\newlength\tempdimen \newcommand{\test}[1]{% \setlength\tempdimen{#1}% \strip@pt\tempdimen }Then\test{5pt}returns5. – cfr May 22 '16 at 01:08\widthofcommand in\FPeval– Werner May 22 '16 at 05:48