The fundamental problem with writing a GOD is that a GOD by definition is Omnipotent, all knowing, all powerful. PERFECT.
HENCE, if you are to write a GOD, then it must be a flawed one, or a nerfed one. And you would have to establish in your world what limits a god has. For example, in one of...