If a combatant declares a spell on a round, they cannot move that round – before or after casting.1) If they are struck, use their dexterity modifier to avoid a blow, or move in any other way, they lose the spell for that round. Casters cannot obtain an advantage by losing initiative and thereby “not starting their spell yet” until after they are struck. Spellcasters start trying to cast immediately at the start of the round, any way you dice it (ha!). Chalk it up to slow reaction (initiative), gathering spell components, whatever.
Spellcasters cannot change targets after beginning to cast a spell. They must cast at the declared target – even if the target is dead – or give the spell up. If the target has disappeared for some reason, the spell is lost.