Idea of "layers" is good for MIDI tables like MIDI<>Grid and so on. The layer actually is filter out some items, it block activity of mapping if current layer index is different. For PangoScrtipt and MIDI it is not required, because script has IF. You understood this part, great. OK, go forward. GetMidiDeviceLayer is a function. Sorry, it is not documented. There are multiple functions, such as sin() or cos(), or pi. There are several specific functions, like this "GetMidiDeviceLayer". It return index of layer of MIDI mapping. But, BEYOND has 4 mappings, and it is important detail. Each scripter has internal variable for current mapping. This variable used for MidiOut command and a few other including GetMidiDeviceLayer. If the scripter belong to MIDI mapping the BEYOND assign MIDI mapping index to scripter automatically. Sorry, it might be confusing, I just explain how it really is.
Function GetMidiDeviceLayer might be undefined in 699. If you use 2.1 then it must work.
Regarding feedback. The simplest solution is to use MidiOut command. It is not really a true feedback that represent current state of ... wait. Do you use encoder that send 00 or 7F only?
Normally, feedback done by means of monitoring parameter state and sending the MIDI message when state changed. In your case it seems more complex. Do you want to show DMX channels value in encoder depending on Shift button state?
Regards,
Alexey