Muharram 5, 1330
1) Here is my answer: This verse, if one were to scrutinize it, overlooking the verses which precede it and which prohibit taking the infidels for walis, does not connote praising the Commander of the Faithful or recommending him for leadership and imamate by threatening dissidents with his might or by warning them against being punished by him. This is so because in the preceding verse, if and when scrutinized independently, Allah Almighty states:
"O ye who believe! If anyone of you relinquishes his religion, then Allah will raise a people whom He loves and who love Him, soft-hearted with the believers, mighty against the unbelievers, struggling in His Path, not fearing anyone while doing so. This, indeed, is Allah's favour; He grants it to whomsoever He pleases, and Allah is vast in knowledge (Qur'an, 5:54)."1
This verse is revealed on behalf of the Commander of the Faithful (as), warning others of his might and that of his followers, as the Commander of the Faithful has himself stated on the Battle of the Camel and is stated by Imams al-Baqir and al-Sadiq.
The same meaning is applied by al-Tha’labi in his Tafsir al-Qur'an. It is also narrated by the author of Muj'maul Bayan fi Tafsir al-Qur'an from ‘Ammar, Huthayfah, and Ibn ‘Abbas. It is interpreted in this way according to the consensus of Shi’as who narrate it consecutively from the Imams of the Purified Progeny (as).
The verse of the wilayat will thus come after hinting to his wilayat and referring to the necessity of accepting his imamate. Its context would then be an explanation of that hint, and an elaboration on the hint that preceded it which suggests his government; so, how can it be said that this verse was revealed in the context of prohibiting taking the infidels for walis?
2) The Messenger of Allah, peace be upon him and his progeny, has himself equated the status of the Imams among his descendants to that of the Holy Qur'an, indicating that they both shall never separate from each other, and that they are equal in significance to the Book (Qur'an) itself; through them can right be distinguished from wrong. To them, taking this verse as a proof is consecutively reported. The meaning they have always applied to the word "wali" in such a context is identical to the one which I have applied above; therefore, context does not bear any weight if you take it to contradict their texts,2 for all Muslims are in consensus regarding the application of context as a proper argument.
When context and proof collide with one another, they abandon the connotation of the context and yield to the judgement of the proof. This is so due to the fact that the connotation of this verse's context is not relied upon, since the Glorious Book itself is not arranged in the order of its compilation, according to the consensus of all Muslim scholars, but according to the sequence of the revelation of its verses.
As such, there are quite a few verses which give a meaning that contradicts their context. Take, for example, the Verse of Purification. The fact that the chapter where it exists deals with women is quite clear in restricting its connotation to the five individuals [men and women] who were covered with the mantle. Generally speaking, to interpret a verse in a way which contradicts its context does not in any way violate its miraculous aspect, it does not harm its eloquence, and it does not hurt to resort to it whenever irrefutable proofs demand it, Wassalamo Alaikom.