Is This Legal? Does the IRS Know About This?
Yes. Section 1031 is part of the Internal Revenue Code. Section 1031 has been around for decades and the use of 1031 exchanges has been approved by courts and set forth in Treasury Regulations.
Can I Buy Before I Sell?
If structured correctly - yes. In such a situation Burns 1031 can establish an LLC to be an "Exchange Accommodation Titleholder" to hold the property for up to 180 days while you sell your property. This is a reverse exchange.
Can I Use Sale Proceeds to Pay Down Debt on A Property I Already Own and Still Qualify Under 1031?
No. That is exchanging real property for debt relief. Exchanges must be "like kind" - in most cases, real property for real property.