When accelerated and cleaned up, shouldn't the gradient be better than at flap 10, even though a higher speed must be maintained? (disregarding loss of climb when accelerating and cleaning up)
Yes, and therein lies the "great Quaker Life debate" over Flaps 10 vs Flaps 20 for takeoff...
Flaps 20 gives a shorter ground roll and lower takeoff speed, but lesser climb gradient. Flaps 10 takeoffs often require higher thrust settings and may contribute to faster tire wear and more close-in noise.
SOPs among 747 operators vary as to which is preferred or mandated. It will likely be the case for some time...