The correct option is B Had I entered
Sentences that begin with 'hardly' are followed by the verb 'had', and then continued with the subject and main verb 'I entered'.
Hence, the correct verb form is 'had I entered'. So, option D is correct.
Options A and B: As the rule tells us to use the construction 'had + subject + verb', these forms won't be used here and these options are incorrect.
Option C: Similarly, this construction is not acceptable. Also, 'did' is used for emphasis on certain actions, but here it isn't required.
Hence options A, B and C are incorrect.