So you want an "assign last used layer to selection" tool...
The problem is how do you find what the last layer that was assigned...
If the tool itself has assigned a layer then it's an easy set/get, but if you use the native tools or another script then how do we know ? Even a layers-observer would be ineffective as that spots changes to layers, we need to watch entities.
An entities-observer that spots changes to each and every entity in the model... and looks to see if their layer has altered, and if so it takes that as the last-assigned layer... might do it, but it seems very cumbersome...
Perhaps a tool in two parts, one to assign a layer [and remember it] and the other to apply that remembered layer to other selected objects...
Sometimes a simple sounding idea is far more complex and convoluted that you at first imagine...