For anyone who comes here and uses this script - there is an issue with the IDENT button in QW787 not resetting back to it's position, staying pressed until you press it with the right mouse button - and it cannot be visually noticed at all.
The result is that you'll get the IDENT function working only once - pressing the button further won't function anymore.
It can be tackled by, for example, simply adding a line with the U (on button release) command for the button in a MACRO script ending with the parameter 1 (right mouse button press) - the way I've done it - for my selected physical button for the IDENT button in the cockpit .
Anyway, we have a working script. Thank You ! Mr.sci.ing. MILAN PUTNIK