How can I maintain PWM output while still performing other tasks?
PWM just runs once started. It's all managed by a completely separate bit of silicon inside the chip.

Once you have done analogWrite(...) the PWM will just keep going until you tell it otherwise.