maybe thats it - it was a hat tip?!. AN imitation is the sincerest form of flattery thing. JK Rowling wrote in the underlying sexual tension of the character and named her after her favourtite movie character sexy teacher. There's probably some joke outtakes of mrs Mgonigil telling Harry to stay back after class.
fun fact (wrong thread sorry harro) mrs mgarrical is susan sarandons daughter. and in the movie 'thats my boy' she plays a young mrs mcgarrical and her mum plays an old mrs mcgarrical.