[z2130] Update the SET_FIELD, FLAG_SET and FLAG_REMOVE commands

They now will work in addition with the buddy system.
Also prevent typos like fixed in recent commits by restricting some variables to a smaller scope

(based on commit [12197] - 7d7c211)

(based on commit [s1756] - 45180df)