SHORT ANSWER:
No. The second sentence is ungrammatical.
LONGER ANSWER:
The past forms you employ, told in the condition or IF clause and would in the consequence or THEN clause, do not signify past tense; they signify unreal mode. These two clauses are both cast in the non-past tense. The Reference Time of these sentences—the time you are speaking about—is therefore non-past, present+future, “from now on”. The simple past form did properly refers the pastness of what you did to that “present” Reference Time: it happened “before now”.
A past perfect like had done, however, must be related to a past Reference Time: it distinguishes an event as having taken place “before then”, not “before now”. In your second sentence the past perfect has no past time to which it may be related; the sentence is therefore ungrammatical.
What you may say is
If I told you how I have done it, it wouldn't be a surprise.
There is however no particular reason I can think of why you should use a perfect there: you are speaking of a past event, not a present state, so the simple past did is preferred.
Have done --- Have done is a present perfect tense, generally it is used when the action is completed recently/just now.
Had done-- Had done is a past perfect tense, generally refers to something which happened earlier in the past, before another action also occured in the past.
For Example:
We have done the work -- Here the action completed recently/just now.
My friend offered me an apple in classroom yesterday, but I wasn't hungry because I had just eaten lunch -- Here the action happened earlier("yesterday"), and another action ("I had just eaten lunch") also occured in the past.
Best Answer
In this case, as long as we are referring to an action in the past, we can say, "John had done it.", the past perfect form.
However, "John had did it" is incorrect. To form the past perfect, we need to use the past participle of "To do", which is "Done"
Note that using "This" implies a connection to the present, so the present perfect is required.