To get black bars you need to change the viewport—the rectangle inside the window where stuff is rendered. In your render script update, you’ll see:
render.set_viewport(0, 0, render.get_window_width(), render.get_window_height())
That sets the viewport to fill the full window. Give it a rectangle that’s smaller than the window to get black bars. Well, actually, they may not be black, they will be whatever your clear color is set to.
This is the little bit of RenderCam’s code that figures the viewport rect for a fixed aspect ratio:
-- You only need to recalculate this when the window changes.
local scale = math.min(M.window.x / curCam.aspectRatio, M.window.y / 1)
M.viewport.width = curCam.aspectRatio * scale
M.viewport.height = scale
M.viewport.x = (M.window.x - M.viewport.width) * M.viewport_align.x
M.viewport.y = (M.window.y - M.viewport.height) * M.viewport_align.y
-- M.viewport_align.x and .y are generally 0.5, which will center the viewport in the window.