Regarding code blocks starting at line 227 (# If EXPORT is more expensive than buy, action CHARGE and CURTAIL solar) and 240 (# If sell price < 0, action CHARGE and CURTAIL solar.)
The reason and comment state that the actions should be action CHARGE, however the action is set to AUTO on both blocks.