Geometrically, whenever $v_1$ is a unit (column) vector, left multiplication of any column vector $x$ by v1 %*% t(v1)
(which is $v_1 \cdot v_1'$) is the projection of $x$ onto $v_1$. In this application, $v_1$ is the first principal component of a centered matrix of columns. Therefore, this code computes the projection of the centered columns onto their first principal component.
Continuing the illustrations at Bottom to top explanation of the Mahalanobis distance?, which describes this procedure in more detail, we may depict it in the two-column situation as starting with

and, after finding the center and principal axis of these points as described there, doing this:

The gray arrows depict the process of (orthogonal) projection; the blue points are the results of this projection. They all lie along the principal axis and everything is done using the point of averages (in red) as the origin. A similar illustration appears at the end of JD Long's explanation of Principal Components Analysis (PCA) at https://stats.stackexchange.com/a/2700.