If you’re going that way it would make more sense to do the PWM in your main code and handle button pushes in the interrupt.
So you’d interrupt on port change and change some variables in the ISR and don’t have to run a loop polling buttons.

Either way unless the PWM is timer driven, it’s still not “emulating something like that”. Even though you might get the job done.