Thank you for sharing your question about how to prepare a bathroom door frame for painting.
I recommend continuing sanding until you have a nice finish on your frame. Once you've removed all the old plaster on the frame and you feel that there are uneven areas between the paint and your frame, I suggest using Earl's 600g White MulTfill Ready To Use Filler to fill the gap. Use the Pro Renovator 38mm Plastic Scraper to evenly spread the filler. Please give the filler enough time to cure before giving it one final pass with your sandpaper.
Once you've finished sanding make sure to clean the area with a vacuum cleaner and to give the door frame a wipe down with a clean cloth. Mask off the areas that need protection using masking tape. Once all the preparation has been done you can now proceed to paint.