Not quite sure the questions. Do you want the gateway shield to be both a peripheral and a central? You could do one or the other, the hardware is pretty much the same between the two, but it would require some system level changes.
As for your second question, the Photon/Electron in the gateway shield can run other code and be a gateway at the same time. But your code must be careful or it could interfere.
Let me know if that answers your questions. If not, please let me know a little more detail as I am not quite sure the nature of the project and what you are attempting.