Scripts taking a while to load what I type

Recently, whenever I start trying to type something in a script, I notice that the text isn’t showing up for about a second or 2 and if I just keep typing while ignoring this issue, studio will eventually freeze until it finally finishes loading what I typed. This issue only happens in rather long scripts, though.