[...] I had a friend of mine in the same situation and he was compelled to stay illegally in the country for years before he adjusted status to permanent resident after his relative petition became current and he could actually file for AOS (adjustment of status). He couldn't go back to his native country as he was already illegally in the US for close to a year and he would trigger the 10-year reentry bar had he gone back to his country and process the green card from there.
If the relative petition for perm residency was such a big obstacle to get a temp student visa couldn't he have his relative withdraw that petition so that he could have his student visa application easily approved?
You obviously don't know what you're talking about! You never withdraw a green card petition (even it may take 4-5 years for it to materialize into a green card) just to get a student visa! Do you know the hell you have to go through with an F-1 visa? Most companies don't interview F-1 students because they know they have only 1 year of OPT (practical training) and they do not sponsor H1-B visas for many reasons. They are unfamiliar with the process and know that hiring an American is much easier. Other employers may fear that international students will sooner or later want to return to the home country and training costs them (upwards of $8,000) Many employers expect employees to have excellent communication skills. Even though international students can speak and write English pretty well, it is often not at the level of American employees.
Assuming you finally locate an employer willing to sponsor you for an H1-B, such employers are notorious about cheating and abusing foreign hires, threatening to have them deported if they protest when they are not paid full salary or benefits. Labor law violations involving workers on H1-B visas are rampant nowadays and H1-B workers don't file complaints because they fear the loss of their visa. If your employer yanks his sponsorship -- which they can do for almost any reason imaginable -- the H1-Bs often must return home and try to find another sponsor -- an arduous task. H1-Bs are essentially indentured servants.