A few tweaks to get a better episode:
1. Trebuches behind the trenches, guarded and controlled by a fraction of the unsullied. Everyone else up on the walls. Fire at the enemy until they reach the trenches, then light it up and keep firing. When the fire start to burn out, retreat and defend the walls.
2. Position the dothraki on a nearby height. When everyone have retreated to the castle they can flank the enemy and cut through them from the side. Would have been cool if they showed what they could do by cutting through the enemy once, but then at the return the WWs came on horseback and showed what they could do by destroying the entire dothraki army.
3. Dragons helping the dothraki until the fog came in, and night king shows up and blast a hole hole in the walls (which the unsullied btw. should have been able to defend excellently up until that point). Ensue the following dragon fight.
4. Many of the main cast could defend the opening in the walls Helmsdeep style, before realising they will get overrun. Here the unsullied could have had their vig moment allowing the remaining forced to retreat to the citadel or something.
5. Follow through with the rest of the episode. Escpecially the Arya line were brilliant. Maybe the Hound could have been put off by the NK dragon blast instead of the planned lighting of the trenches.