If you have a credit card that provides frequent flier miles or points and you file bankruptcy, you will–most likely–lose those miles or points.
Whether you keep or lose the points is up to the lender. Bankruptcy doesn’t force the issue, but every lender I have encountered has a policy/clause in its credit agreement that if the debtor defaults or files bankruptcy, the lender can revoke the miles or points.
Even if the card has a zero balance when you file bankruptcy, you will still lose the miles. As such, there is no benefit to trying to pay-off that card prior to filing bankruptcy. To answer your next question, you cannot pick and choose which creditors to include in your bankruptcy. You are not allowed to file bankruptcy against all your other creditors and exclude your miles card.
Moreover, it is highly unlikely that a bankruptcy judge would approve a reaffirmation agreement if the sole reason for doing so is to keep the miles. But again, the issue is up to the lender, and I haven’t encountered a lender willing to entertain a reaffirmation agreement to retain miles.
You should not allow this question to determine whether or not to file bankruptcy, but you should be aware that if you accumulated miles or points on a credit card, you will lose them if you file bankruptcy.