Not sure there is a unique solution. You might be able to derive it analytically with additional constraints. And as technocrat points, it might not make sense to compute the sd on 4 points.
Anyway, you can do it by numerical optimization:
fn_to_minimize <- function(new_x, x1, x2, target_sd){
abs(sd(c(x1,x2,new_x[1],new_x[2])) - target_sd)
}
optim(c(1,2), fn_to_minimize, x1 = 1, x2 = 2, target_sd = 10)$par
# [1] -11.92944 12.48387
sd(c(1, 2, -11.92944, 12.48387))
# [1] 10
See the documentation of optim() for how it works. Also note that it may be slow if you're trying to do that a lot of times.