If a "script" is critical, has to handle lots of error conditions, has to always have reasonable behavior, and is part of any kind of production setup, then it becomes more like programming.
Scripts I think are meant to be run by tech people so might lack documentation, error checking, etc.
Often you'd write a script to set up the environment for a program; paths, environment variables, rotate previous logs and write PID files. Small scripts can evolve, and if they are part of an important program, can be more complex.
Programmers tend to write programs, while system admins used to write the bulk of scripts.
I'm not sure these divisions are as clear anymore, but that feels like how things originally evolved.
I think classically a script is a program whose subunits are each complete programs ('commands') that operate on a shared environment, with shell scripting being the central example. The definition has since been expanded by way of analogy to include basically any interpreted program which may have side effects on its execution environment.