You can open your game to LAN, join with the spectator account, and record your screen using something like OBS, but for the actual timelapse itself you'll probably have to use an editing software. You'll also need a 2nd monitor (or a 2nd computer) to record with.
As for keeping your screen open, you can change the "pauseOnLostFocus:true" option in your options.txt file (In your .minecraft directory) to keep the screen open even when you're tabbed.
You might have a problem with recording the second instance of the game because most of the recording software records what is presently on the screen. If the spectator account is in the background the recording software might not capture it. As far as I know, most people have a second computer to play on while they record the timelapse on the first computer.