Hey,
if your question is more from technical or coding, You dont need special X++ code to make PBS work. Your SysOperation batch job will automatically participate in PBS scheduling
PBS will allocate processing capacity favouring the higher priority jobs first. Microsoft defines weighted processing across priorities, with Reserved Capacity and Critical receiving the largest share of resources.
There can be different consideration for different requirment on how you need to configure your batch jobs.
For more details you can read MS lean page.
Priority-based batch scheduling