I edited your question to make it easier to understand. I hope that I didn't change your meaning. If I did, I apologize and ask you to correct me.
Now for my answer:
Your server should be aware which user is currently logged in to which device. You should maintain in your server a table of logged in users, and for each logged in user it will hold the identifier of the device in which he/she is logged in. In order to do that you have to send a request to your server each time a user logs in or logs out. The request should contain the user id and the device id. For the device id you can either use the Registration ID or use some other ID that your server generates (it might be better to generate an ID in your server that would be shorter than the registration ID and therefore more efficient to use. You'll have to maintain a table that maps the registration ID to the device ID).
When the admin creates a new offer and assigns it to a user, you will send a GCM notification to the app only if the user is logged in. Therefore, in your example of two users using the same device, if one of them is logged in, you will send only a single notification to that device for the logged in user. If none of them is logged in, you won't send any notifications. You will store the new offers in your DB and wait until one of them logs in.
When a GCM message arrives to the device, you should make should that it is addressed to the current logged in user, since it's possible that one user logged out after the message was sent but another user logged in before it arrived to the device. For that purpose, your GCM message should include the user identifier as an additional field. If a message arrives to the device with a user ID that doesn't match the current logged in user, you discard that message and don't display a notification.
When a user logs in, the server will receive a request (see #1). In the response of this request the server should return to the device all the offers that the user has in the server's DB.
As for messages that were sent while the device was inactive for a long period of time - when the device becomes active again, old messages might be sent to it from GCM (if they haven't been discarded by GCM yet). If these messages don't belong to the current logged in user, you discard them (see #3). If they belong to the current logged in user, you should display them.
I don't know PHP, but from my limited understanding of your server's code, it seems that you send to the device a GCM message that contains the number of offers the user has. You should probably use the same collapse_key for all messages you send. This way, if multiple messages were sent by your server while the device was offline, only one of them will be sent to the device when it becomes active again. You don't need to get all the pending messages if all they contain is the number of available offers.