That is a very good idea and you were given a valuable advice.
In some cases, such as for your employer's shares held in the 401k account - distributions qualify as a Net Unrealized Appreciation (NUA) distribution. In this case you are taxed only on the original cost of the company stock in the 401k account, and then pay capital gains tax on the appreciation only when you sell the shares.
You may find additional information and examples about NUA distributions in this article - http://www.tuveinvestments.com/pdf/Retirement/Net%20unrealized%20appreciation.pdf.
In your situation - you are correct - if you sell shares in the same year - the gain will be treated as a capital gain.
hen - see in the article I referenced above - How stock is taxed
Any net unrealized appreciation (the difference between the fair market value of the stock on the date of the distribution and the fair market value as of the date it was contributed to or purchased by the plan) attributable to these securities is not taxed until you sell the stock. Additionally, when the stock is sold, the net unrealized appreciation as of the date of the lump-sum distribution is taxed at the long-term capital gain rate, currently 15%, rather than as ordinary income, which may entitle you to more favorable tax rates on this sum. Any additional appreciation that accumulates after the date of the lump-sum distribution would need to be held for at least a year to be given long-term capital gains treatment.
The NUA will be shown on box 6 of the 1099-R but not in box 2A which designates the taxable amount. See Form 1099-R and instructions regarding box 6.
Also see page R-9. http://www.irs.gov/pub/irs-pdf/i1099r.pdf
If you sell the stock in the same year - you will be subject of AMT - alternative minimum tax ~$5000 - so your total estimated tax liability would be ~$58-59k
Let me know if you need any help.