I am reading from your question that you are trying to stay in the property as long as possible. If that is the case, then my advise will depend on the type of bankruptcy you think you are going to file.
If a Chapter 13, you want to file the BKC sooner as opposed to later, as the arrears will continue to increase and your plan will have you paying more and more money each month--as there is a 60 month maximum.
If a Chapter 7, you can either file before the hearing on the Motion for Summary Judgment, or the day before the sale to get the sale canceled. In either event, either the hearing or the sale will be canceled. Either way, the plaintiff will have to get bankruptcy court permission to go forward with the foreclosure action in state court, and that takes several months. It has been my experience that if the sale date had been set and then canceled some of the judges are simply re-setting a new sale date, without a hearing. My recommendation is that you file the BKC before hearing on the Motion, so that the plaintiff will not be able to merely get an Order resetting the sale; instead, the plaintiff will have to get Court time again, which could be several months down the road, and then have the judge rule on the motion at that point in time.
Oh, and I am not trying to be funny...but June 1 is not that far away. The significance of June 1 is that it is the beginning of hurricane season. For years, I have counseled my clients who did not have a pressing need to file a BKC to hold off, as with a storm, it might be that the insurance company will wind up paying off the mortgage.