Simplified code:
function DefenderCreatureMove(unit)
local last_mana = GetUnitManaPoints(unit);
SetUnitManaPoints(unit, 100);
sleep(30);
local player_units = GetCreatures(ATTACKER);
UnitCastAimedSpell(unit, SPELL_BLIND, player_units[0]);
sleep(1);
SetUnitManaPoints(unit, last_mana);
endAdded 22 minutes later
Although it seems that there is some more general mechanic at play here – when I cast a regular spell with a hero, the remaining duration of its effect also differs if you look at it through the creature on the battlefield and through the icon on the scale. But it occasionally synchronizes.