What I found useful -
Obviously a variable, or save to database (array, dictionary) of whose turn it is
activeturn = "0" (computer, player1, etc)
activeturn = "1" (human, player2, etc)
At end of turn, swop activeturn.
I put all my (computer or player 1 code into a group)
I put all my (human or player 2 code into a group)
Then perform a check and disable the non active group.