I have heard time and again that scripting languages can be used to
quickly speed up the development process for a game.
Essentially, that’s true. But strictly speaking, this actually isn’t limited to scripting languages. Replacing old code with new code on-the-fly can be even done with C or plain Java.
What exactly are the uses of a Script[?]
Generally speaking, any kind of “cold” code (i.e. code which gets executed rarely and which isn’t processing intensive) can be replaced with scripts.
Scripting in games is often used for some sort of hybrid which is somewhere between configuration and code. Basically, it’s some configuration with logic thrown in. E.g. there are conditions here and there and arrays/dictionaries and some loops to keep things DRY (don’t repeat yourself -> less repetitive) and maintainable.
E.g. if this weapon (a shotgun) is fired, there shall be 12 randomized projectiles each one got a knockback of 5, this particular sound file should be played, this animation is triggered, and the next shot can be fired in 500 msec.
Or things like UI, HUD/overlays, menu transitions, etc.
There are many AAA games which use Lua for this kind of thing.