I just uploaded a module called "(tmt) Lock Layers xy" to the public section of the online library. It's a module I did over a year ago and sent it to Lupin and Deepvisuals for testing. Today I polished it a bit and published it.
There is no way of locking a layer in Module which is frustrating if you are doing something where the position of the layer is very important. Like for instance a video mapping project. There is also no way of coding a module that cancels the position event so the best we can do is checking if you moved something and then switch it back to the previous position. It's a pretty ugly solution since you will see the object move and when you release it the object will snap back. But it's better than nothing and it can really save the day.
The module is layer contextual which means that the module will lock the active layer. But the "All layers" button will lock/unlock all layers visible in the Module interface. It does however not effect non visible layer sets. Enjoy!