I think that a vital piece of information is missing in your question:
How many operations take 1 operand, and how many operations take 2 operands?
Suppose 97 operations take 1 operand, and 31 operations take 2 operands:
In the first group we have:
Operation length = 7 bits
Operand length = 19 bits (check the binary representation of 512000)
Total length = 7 + 19 = 26 bits
In the second group we have:
Operation length = 5 bits
Operand length = 19 bits (check the binary representation of 512000)
Total length = 5 + 19*2 = 43 bits
And of course, you will have to define the operations in a manner that will allow the CPU to translate them without ambiguities (for example, 1000011...
can be a 7 bit operation, or it can be a 5 bit operation with 11...
as the first operand).