Here is how I was able to get the OP's .lua file to load/work correctly as of today's date (05/25/2014):
1.) Save OP's (OP = Original Poster) .lua file to your Desktop (or anywhere that you will be able to find it) by either right clicking and choosing "Save as" or clicking on the OP's link, "selecting all" (ctrl+A), and then copying the contents to a new text document (change .txt extension to .lua and save).
2.) Change the file name to (DO NOT INCLUDE QUOTES): "Logitech Extreme 3D Pro USB.lua" <-- COPY AND PASTE TO PREVENT ERRORS!!!
3.) Open the re-named file with notepad and delete "function layout()" at the very top and then delete "end" at the very bottom. Save the changes to the file.
4.) Then go to:
C:\Program Files (x86)\Steam\SteamApps\common\DCSWorld\Mods\aircrafts\A-10C\Input\A-10C
***__Ensure you are using the correct File path!!___***
5.) Copy and Paste the "Logitech Extreme 3D Pro USB.lua" file you had saved to your desktop into the "joystick" folder.
6.) Start the game and go to "Options" and then choose the the "Controls" tab.
7.) Choose "A-10C Sim" from the "Layer" drop down menu.
8.) Verify that ALL the controls from the .lua file are correctly loaded and displayed in the "Logitech Extreme 3D Pro" column (which they should be if you followed the above steps correctly). If the majority of the commands are highlighted in red, then go to the next step. If the commands are NOT highlighted, then you should be good to go.
9.) If any of them are highlighted in red, then that means you need to add joystick buttons 7-12 as modifiers. You will do this on the same screen by choosing "MODIFIERS" in the bottom left corner.
10.) Choose "ADD MODIFIER" in the "MODIFIERS PANEL".
11.) Select the Logitech joystick in the "Device Name" drop down menu of the "ADD MODIFIER" window.
12.) Press the "7" button on the joystick. Now you should see "JOY_BTN7" in both the "Select modifier button" and "Modifier button name" in the "ADD MODIFIER" window.
13.) Choose "OK" and then repeat steps 9 through 11 until all six of the joystick buttons (buttons 7-12 on the joystick) are added to the modifiers list.
The finished modifier list should look something like this (including the default modifiers):
JOY_BTN10
JOY_BTN11
JOY_BTN12
JOY_BTN7
JOY_BTN8
JOY_BTN9
LAlt
LCtrl
LShift
LWin
RAlt
RCtrl
RShift
RWin
14.) After you are sure you have ALL the modifiers added, then click "OK" in the "MODIFIERS PANEL" and the red highlight should disappear in the Logitech Extreme 3D Pro column. The joystick "should" now work the way the original poster intended (All the commands I have tried worked so far).
If anyone has a more "elegant" solution to the problem, then by all means please share for future reference. If not, then hopefully my method works correctly for the rest of you! :)