Here is a example script. I will call it script one.
local UserInputService = game:GetService("UserInputService")
local Key = 'Q'
UserInputService.InputBegan:Connect(function(Input, IsTyping)
if IsTyping then return end
local KeyPressed = Input.KeyCode
if KeyPressed == Enum.KeyCode[Key] and Debounce and Char then
Debounce = false
local LoadAnimation = Char.Humanoid:LoadAnimation(Animation)
LoadAnimation:Play()
And this is another example. Script two.
game.Workspace.Player.Humanoid.Running:Connect(function(speed)
if speed > 0 then
print("Player is running")
else
print("Player has stopped")
end
end)
Why did the scripter not use "return end" on script two? They just used end right after print.

2 comments
In the first example the scripter just wanted to return the value end, and in the second they are ending the script.
Well that is how I think about it