I have an idea:
Have it assign the demigods 1 at a time. For example, start with Team 1, Player 1. Then Team 2, Player 1. Etc.
If Team 1, Player 1 has a General, Team 2, Player 1 will get 1 as well. Also, Team 1, Player 2 will receive an Assassin, etc. Naturally, also checking each time that your team does not already contain this DG.
This would maintain an even mix of assassins and generals while still remaining fully (pseudo)random.
Also, I believe anything involving not allowing certain DGs to go up against others ( such as strong v weak ) is both subjective, and kills the random nature a good deal. Just my personal opinion there though.