I think it’s right to see both options in the Euthyphro dilemma as unacceptable, but I think the Bible does present a third way. That is, God’s commands are perfectly consistent with his character. 1 John 4:7-8 is helpful here:
“Dear friends, let us love one another, for love comes from God. Everyone who loves has been born of God and knows God. Whoever does not love does not know God, because God is love.”
We’re commanded to love here because God is love; love defines his nature. It’s not that love is a higher principle that God is in line with or that he arbitrarily decides love is good, it is his nature.
So for ethics, really all morality comes down to this principle of love that is found in God’s nature, so long as it is understood that justice and mercy are necessary elements of the love we are talking about. Thus even God’s final judgment of the world is a loving act because justice must be upheld by a loving God. And as the above passage goes on to say, it’s in Jesus that we see the perfect love of God and from whom we learn the content of ethical behaviour.
But we are left with the question of a hypothetical evil God. Would we have to say the same thing, that because it is his nature it is good? In the end, I don’t think this question makes sense. Our sense of good and evil is grounded in God himself and we only have him as a reference point. All that can be said is I’m really happy with the God who’s there!