The whole point of the second conditional is to talk about a hypothetical consequence of a hypothetical situation: one that (as far as the speaker is concerned) isn't going to happen. For it to be a true second conditional, the tense of the consequence-clause is backshifted to indicate that the consquence is also hypothetical.
If you change the tense of the consequence-clause to an imperative, it is no longer a second conditional.
By using an imperative, the speaker is indicating that they are talking about a non-hypothetical consequence, and that could never be the consequence of a hypothetical situation.
Tell me if you needed something.
This sentence is grammatical, but it does not fit the template for a second condtional. It's only a second conditional if the verbs in both clauses are backshifted.
What it means is if you needed anything in the past, please tell me now.
Here's a situation where it might be used. A science teacher is preparing a practical exam, and wants to make sure that all of the required equipment and materials are available in the lab. The teacher asks a technician to do the dry-run. Once it is completed, the teacher might say to the technician "tell me if you needed anything [that wasn't available]". They are discussing a real situation that occurred in the past, not a hypothetical situation in the future.