Primary action to the right
Some best practices recommend the primary action (default) put to the right. This also was a result of a survey by MeasuringUX.
So when reading (from left to right) the last focussed spot allows clicking. The right alignment is also associated with "next" or "forward" movement, whereas cancel button put before ok suggests "...
Your interface getting distracted while you put the HELP button on the right side with your primary action buttons.
I recommended aligning the HELP button in the left position, so your interface doesn't get distracted while your users check and uncheck the "Help button visible" option.
Both options seem equally wrong to me: it actually is a dilemma.
One way to resolve the dilemma would be to deactivate the TabStop for the Help button and add the hotkey F1 to the form, ideally also shown on the help button (Caption: "Help (F1)"). This would make help most accessible and didn't distract from completing forms.
Besides this, OK has the ...
Personally, I think there's nothing wrong with your placement.
Just one suggestion: Make sure that all input fields have the same width; that way you'll get a much nicer overall alignment and it helps putting emphasis on that checkbox, since it's the one element popping out.
I also put a bit more space between the form and the action buttons, so that the ...
I would go with your second example. For a single reason. The buttons need to be placed in the order of positive action, negative action and such.
So from a user standpoint it gets to : Is this error ok ? Press OK / Do I want do cancel ? Press Cancel / Nothing works ? Get help.
I think that's the right place to put a help button.
You should either have the help button left-aligned
Or move it to the top, next to the close button. Use the question icon. It used to be a standard
download bmml source – Wireframes created with Balsamiq Mockups
I tried to prepare a simple showcase how you might prefer to apply it onto your case. Even I preferred to use the color markers on the left side of the folder names, you may try to apply it on the right-most part alternatively.
The colors are up to you but I reccomend red one for locked ...
To account for good User experience, you can indicate the references that are in use or not (the difference can be colour) and indicate those that cannot be tampered with (use of padlock icons as you've mentioned).
However, you could also tweak the arrangement just like you have it in the sample picture that all unactionable elements, references in use and ...
To me, greyed-out list items mean those that are "of little interest" - in context that would mean references that are currently unused. You already have padlocks to indicate non-actionable items, whether or not they're used. Unlocked references should be removable.
Consider how modern VS handles this - references are removable, regardless of whether or not ...