The improved spell addresses the flaws of the original well, particularly the movement increase and the upcasting flexibility. However, trying to imitate and outdo Bigby's in sustained damage sacrifices the uniqueness of the spell and will intrinsically be overpowered.
Damage Comparison
vs Disintegrate:
The 1st turn damage of Mordenkainen's Sword (Improved) at 7d10 is 77, compared to the 85.5 of Disintegrate. However, on the second turn, the spell allows the use of a bonus action attack potentially followed by the casting of a different concentration spell, bringing the total damage to 115.5 using 1 action and 2 bonus actions (a minimal investment for a wizard).
At 6d10, this is reduced to 66 and 99, respectively, straddling the damage of disintegrate.
vs Bigby's Hand:
With the extra 1st turn attack, Mordenkainen's Sword (Improved) 6d10 (33) stays ahead of the 8d8 (36) DPR of Bigby's Hand in total damage for 11 rounds (beyond the duration of the spells), meaning MS already has better damage output.
Given the burst damage on the first turn, 6d10 is appropriate damage for the sword.
Suggestion
Enhance the uniqueness of the spell as a sword. Most attackers utilize multi-attack by this level. Consider leaving the damage of the sword as is, but allowing 2 attacks after it has moved, emulating a physical fighter.
Mordenkainen's Sword (improved)
7th-level evocation
Casting Time: 1 action
Range: 60 feet
Components: V, S, M (a miniature platinum sword with a grip and pommel of copper and zinc, worth 250 gp)
Duration: Concentration, 1 minute
You create a sword-shaped plane of force that hovers within range. It lasts for the duration.
When the sword appears, you make 2 melee spell attacks against a target of your choice within 5 feet of the sword. On a hit, the target takes 3d10 force damage. Until the spell ends, you can use a bonus action on each of your turns to move the sword up to 60 feet to a spot you can see and repeat these attacks against the same targets or different ones.
At Higher Levels. When you cast this spell using a spell slot of 8th level or higher, the damage increases by 1d10 for each slot level above 7th.
This gives the spell a unique feature and offers more consistent damage while preserving what makes the spell interesting.
Feats or Class Features to be Wary of:
The assassinate feature of the Assassin specifically uses the wording "any hit you score against a creature that is surprised is a critical hit." A 3 level dip into Assassin allows for absurd 1st turn damage by all improved versions of this spell not typically afforded by save spells.
Disclaimer
Let me start this answer with a statement that I think must be made: rarity of magic items is a very poor indicator of power level. Of all the indicators of power levels we have in 5e (CR, spell level, character level, gold cost for regular items), rarity of magic items is, by far, the one that least represents the power level of what they represent. For that reason, it is mostly up to the DM to judge how rare an item actually is.
While a Necklace of Fireballs is a Rare item that allows to cast 4 to 9 Fireballs (one of the best 3rd level spells in the game), so is Elixir of Health, which is essentially a one-use Lesser restoration all in one, but still a very situational item that most likely will have the exact same result as the 2nd level spell when used (because you rarely get 5 conditions affecting you at the same time).
Rare seems fine (And I would say solid rare)
Your item is on par with decent consumable rare items. Here is the math:
Let \$p(i)\$ be the conditional (on the fact it did not break in previous hits) probability of the sword breaking at \$i\$-th hit, defined by the sequence $$p(i) = \frac{4 + i}{20}$$
and \$q(i)\$ be the probability of it not breaking $$q(i) = 1 - p(i)$$
Then, the marginal probability of the sword breaking at the \$k\$-th trial is given by
$$P(k) = p(k) \prod_{i=1}^{k-1}q(i) $$
which is basically this vector:
$$[0.2500; 0.2250; 0.1837 ; 0.1365 ; 0.0921 ; 0.0563 ; 0.0310 ; 0.0152 ; 0.0066 ; 0.0025; 0.0008 ; 0.0002]$$
This is an extension to the Geometric Distribution, for those interested.
The expectation is 3.03 attacks. So, the expected damage is \$3.03 \times 21 + 31 = 94.63\$.
On the other hand, you are using your attacks to attack with this weapon, rather than an usual attack. Assume you would attack with a regular Longsword if you were not attacking with this sword, that would give you \$3\times4.5=13.5\$ damage. So, your net gain is 81.13 points of damage.
If you use the Necklace to cast a 9th level Fireball (which is not optimal!), you would do 49 damage on failed save and 24.5 on successful save. Having 3 creatures in the area - which is quite usual, and is the scenario where you would be using the Fireballs, most likely, and one of them failing, already gives you a total damage of 98, or net gain of around 90 (since the modifier is not included in this damage), since you only used one turn.
Overall, I would say the item is slightly worse than the Necklace, but the Necklace is already a top tier Rare item that could easily be "upgraded" to Very Rare.
Some balance comments
The thing with your sword is that is is extremely unreliable. I understand that you wanted to make it unreliable, but I feel you may have gone too far on it. In particular, as I mentioned in the comments, using d20 as the hit dice is very uncommon. I would prefer it being 4d12 - it even deals a little more damage, but more importantly, it reduces the swinginess on the damage roll (see Central Limit Theorem). It is still very swingy in that it may break in the first trial or in the sixth, but, at least, the damage is a little more reliable. If you think this goes against your design philosophy, then keep the d20 as dice roll.
To illustrate the actual distribution of damage, while the average is 94.63, the standard deviation is 42.77, and the distribution looks like this:
You are most likely dealing something around 40 to 80 damage with the sword, and sometimes boom, it lasts to deal more than 200.
Now, consider that consumable magic items are usually used in times of despair. This much unreliability makes the item considerably less powerful. It is clearly way better than an Uncommon item, but it may not be as close to Very Rare as you initially thought.
About critical hits
The reason that I did not want to consider critical hits is that it makes the comparison with other items meaningless. For an enemy that you will be hitting most of the time, the difference is negligible (e.g., AC = 12, Modifier = +8, the difference is 4 points of damage in average, up to 85.2 net damage), while for high AC, while the net total damage will be higher (e.g., AC = 24, net increase = 95.18), the problem is that now you are spending all your turns missing your attacks and dealing actually no damage at all, and then when you hit, you deal lots of damage. Meanwhile, the guy using his Fireballs from the Necklace will be doing a way higher average DPR, because it is actually doing damage every round. Also, if you are facing an enemy that you can only hit on critical hits, you are most likely doing something wrong, because Bounded Accuracy pretty much prevents this scenario.
The only situation where I can see the sword actually approaching Very Rare power levels is if you consider the scenario of an Assassination Rogue using it and you manage to consistently get Surprise, or you can consistently get Unconscious or Paralyzed enemies, forcing automatic critical effects. Then, the massive damage from the dice rolls will be more relevant. But then again, I doubt these are the scenarios the players will be willing to use their magic items on - it's more likely they would like to try it in the Big Boss that is fully awaken and its 8 minion thugs.
Best Answer
Mordenkainen's sword isn't underpowered - it's terrible
It's bad for a concentration spell
At any given level, the spell you chose for concentration should be one designed to "win" that encounter. When you first gain 7th-level spells as a 13th level wizard or bard, you have tons of concentration spells to chose from.
(Bards can only learn reverse gravity, wall of force, and Bigby's hand via Magical Secrets.)
I think it's important to highlight how much better Bigby's hand is than Mordenkainen's sword. In my experience, most fights in 5e last around 3 rounds. For this calculation, I will assume all attacks hit.
It's bad for a non-concentration spell
In the earlier list, I only ran through concentration spells. What about non-concentration spells?
(Bards can only learn crown of stars and steel wind strike via Magical Secrets.)
Conclusion
Mordenkainen's sword isn't just underpowered, it's brokenly bad. In nearly all situations, I would rather spend concentration on a 3rd-level hypnotic pattern than Mordenkainen's sword. The sword would be underpowered as a 5th-level spell, much less 7th.
Want to win most encounters? Pick a control spell. Want to deal a bunch of damage? Pick Bigby's hand or steel wind strike. Whatever you do, don't pick Mordenkainen's sword.