Automation. It can be used to automate tasks in an app. For example, a common task in a Photo Editor app is to resize photos. But resizing 100's of photos manually can be a pain. If the app has scripting support, you can write a script to resize photos and just run it. It can also be used to add the feature of creating extensions / add-ons for an app. (See https://www.gnu.org/software/guile/ ).