All the information can be found here GuiObject | Documentation - Roblox Creator Hub
You simply change the size to what you need (GuiObject | Documentation - Roblox Creator Hub), and then to center it you have to modify the position (GuiObject | Documentation - Roblox Creator Hub).
The position should always be {0.5, a},{0.5, b}, where
a = -frame.AbsoluteSize.X / 2
and
b = -frame.AbsoluteSize.Y / 2
in order to have it perfectly centered.
So you can do something like that to make it bigger:
frame.Size = UDim2.new(0.32, 0, 0.42, 0); -- modify these to what you like
frame.Position = UDim2.new(0.5, -frame.AbsoluteSize.X / 2, 0.5, -frame.AbsoluteSize.Y / 2);
and that to make it smaller again:
frame.Size = UDim2.new(0.16, 0, 0.21, 0); -- modify these to what you like
frame.Position = UDim2.new(0.5, -frame.AbsoluteSize.X / 2, 0.5, -frame.AbsoluteSize.Y / 2);
You can use TweenService (TweenService | Documentation - Roblox Creator Hub), to make the scaling process look smooth, because in my solution the GUI will be either big or small. TweenService will allow you to interpolate between these sizes while changing from one size to the other.