Method 1: place signs or simmilar blocks around the lever. For the lever not to be destroyed by Players give then Adventure mode (
/gamemode @a a)
Method 2: Use this all-version-usable Command block & Redstone syntax:
Where the lever is at positive X from the Redstone. The right Command block has this command:
/testforblock ~+2 ~ ~ minecraft:lever
And the left one has this:
/fill ~+7 ~ ~ ~+7 ~ ~ minecraft:lever N
Instead of N use the lever rotation value. List of possible rotations:
N | Rotation
0: Lever on block bottom points east when off.
1: Lever on block side facing east
2: Lever on block side facing west
3: Lever on block side facing south
4: Lever on block side facing north
5: Lever on block top points south when off.
6: Lever on block top points east when off.
7: Lever on block bottom points south when off.
The lever can get destroyed, but immediatley replaced
I think you can remove the Repeater :-)
You can have the command blocks really far away, it works the samr, just the coordinates will be different.
You can update this to use the 1.9 Command block stuff
It's easy-to-build! Go do it yourself!