Insert sidebearing formula with script

Is it possible to enter a sidebearing formula with a script?

Idea: font.glyphs[‘A.sc’].LSB="=A/2"

Yes, but not like this. These things are called metric keys.
You’ll find all the details here: http://docu.glyphsapp.com

Thanks.