I’m not worried. I’m confident that Boeing has some excellent software developers who can write code to detect improperly locked folding wings. Plus, I’m sure they will get thorough test pilot input.
I guess I'd start with the weight-on-wheels switch so that the wings can only be folded when the aircraft is on the ground.