Tips on Setting up Vanilla Mods
Most of the work isn't finding a command or series of commands to have running. Odds are you'll just use other peoples inventions, as a lot of ideas are already out there and perfected.
The real brunt of the work is setting up a chunk to have loaded at all times. Chunks in minecraft are 16x16x255 "chunks" of the loaded world. As you explore, more chunks are loaded, and the ones behind you eventually unload and are saved.
Why is this relevant? Well if you're command block invention is in an unloaded chunk, it stops working.
In Vanilla Minecraft, theres one kind of chunk that stays loaded at all times: The world's spawn point. When a spawnpoint is set, the chunk it is in is loaded at all times. If you don't want to use that chunk or have a different chunk you want loaded, you can change the world spawnpoint to where you're currently standing by entering this console command:
To actually see where the chunk boundaries are
...you can see the information by pressing [F3] and looking in the highlighted area below:
The entire span of the chunk will stay loaded, from the void down at 0 on the Y axis, to the height limit of 255 on the Y axis.
To effectively keep command blocks hidden (like on a server) I recommend encasing a part of the chunk in Bedrock, or having a command that teleports normal players just outside of the spawn area whenever they get close.
In other words...