One way to check if the call is from the customer can be simple checking Call.CalledAddressOriginal matches the inbound numbers for customers, that is assuming department to department uses a different method of calling than customers, or checking if call ani is sip with your domain for genesys to genesys calls.
For increasing priority for internal calls you have a few options. If the agents are using the agent script to press a button or link that calls another queue, then ideally you have that point at an internal transfer flow where you can increase the priority and make any other decisions. If they are calling the queue direct in Genesys you would need to update the priority while In Queue.
For in Queue, there is some limitations, mostly around if there is an agent available it will never get to the action to update priority or skill, but in Queue or in a flow, you have the set priority Action (https://help.mypurecloud.com/articles/set-priority-action/) which lets you set the priority, very easy to use.
I created a little common module that will retrieve the current priority, increase it by the input amount, and then store the new amount, and use this in a bunch of flows, so i'm always adding to priority rather than replacing it.
------------------------------
Anton Vroon
------------------------------