After you file

Technically there is no requirement to file the 3115 so you can get the benefit of the depreciation you didn't take over the last 20 years.  however, the tax laws still require you to compute the gain and thus the taxes on the sale as if you did. without the 3115 you can't take depreciation in the year of sale. so see a pro.