Let's analyse each of the options provided for grammatical and logical coherence:
- Hardly had the function got over, the crowd dispersed: The sentence is grammatically sound, and is the correct answer.
- Hardly have the function getting over, the crowd dispersed: The verbs 'have' and 'getting' are never used together.
- The function was not got over after the crowd were dispersed: Should instead have been 'has not got over' but there would still be issues.
- Hardly had got over the function, the crowd disperse: 'had got over' is in the past tense whereas 'disperse' is in the present.
The correct answer should be option A.