You should consult a tax consultant specializing in these transactions before considering this option. There is a possibility of deferral of gains on sales of certain types of corporate stock under Section §1045. Section §1045 essentially works like the old capital gains rules for the sale of a primary residence. Specifically, §1045 allows non-corporate taxpayers to defer (elect to rollover) the gain on the sale of Qualifying Small Business ("QBS") stock if the gain is invested in another business. Similar to the old law that applied to the sale of personal residences, the basis of the replacement QSB stock purchased must be reduced by the amount of gain that has been deferred.
This is a very brief overview of the complex rules under §1045. You should consult a CPA before thinking about this possibility. Please note: A Business Broker is not authorized to give you actual legal or accounting advice. Be sure to consult an attorney or CPA for advice in a business purchase or sale.