The United States became involved in the Korean War through its membership (and, in reality, leadership) of the United Nations. The intervention was the result of a UN resolution that the Soviet Union, though a member of the Security Council, did not veto because they were boycotting the UN at the time in response to the refusal of that body to recognize the People's Republic of China.
In any case, the Soviet Union, while probably deeply involved in planning and encouraging the invasion of South Korea by forces from the North, had no desire whatsoever to get involved in an open war with the United States. While Soviet pilots flew sorties against the UN forces, the fact that China poured in hundreds of thousands of troops in support of the North Koreans was itself an escalation that made Stalin very wary. The Soviet Union proposed peace talks in 1951 that divided the peninsula along the 38th parallel. For his part, US President Harry Truman also was worried about escalating the conflict, which led to a very public falling out with General Douglas MacArthur, who advocated a general war against China. Truman fired MacArthur, and maintained his limited goal of not losing ground to communism.