I believe your first interpretation is probably correct, although I’ll admit that it is a bit ambiguous. It could be made clearer if the for-phrase were moved to the beginning of the sentence (and followed by a comma). The complete context should make it clear whether it’s Machiavelli or the Duke who is thinking about the usurpers.