Thanks to Kit Baum, a new package -peerreview- is now available on SSC.

-peerreview- randomly assigns papers to peers for review, based on the principle of assignment without replacement which ensures that each paper is assigned an equal number of times. Assignment is carried out with two constraints: Reviewers cannot review their own paper and reviewers cannot read papers more than once.

-peerreview- can be useful for teachers who want their students to review a specified number of papers of their classmates.

-peerreview- arose out of this topic, and I'm indebted to Lance Erickson who came up with the idea to use Mata to do the randomization.

Below are some examples.
Code:
// example 1
set seed 1234
peerreview, reviewers(4) papers(2) clear
list, noobs

  +------------------------------+
  | reviewer   review1   review2 |
  |------------------------------|
  |        1         2         4 |
  |        2         3         1 |
  |        3         4         1 |
  |        4         2         3 |
  +------------------------------+

// example 2
set seed 2020
peerreview, r(4, name(student)) p(2, name(peer)) clear
list, noobs

  +-------------------------+
  | student   peer1   peer2 |
  |-------------------------|
  |       1       3       4 |
  |       2       1       4 |
  |       3       1       2 |
  |       4       2       3 |
  +-------------------------+

// example 3
clear
input str14 student
"John S."
"James B."
"Maria F. G."
"Patricia B."
end

set seed 1212
peerreview student, p(2)
list, noobs


  +-----------------------------------------+
  |     student       review1       review2 |
  |-----------------------------------------|
  |     John S.      James B.   Maria F. G. |
  |    James B.       John S.   Patricia B. |
  | Maria F. G.      James B.   Patricia B. |
  | Patricia B.   Maria F. G.       John S. |
  +-----------------------------------------+