Is it possible to use the state pin of the hc06 bluetooth module so that the arduino is informed about the exact moment of the module connection or disconnection?
Why don't you do some testing and see for yourself
I don't even think the HC-06 normally has the state pin broken out - did you mean "HC-05"?
Check the data sheets. There is a stray line off pin24 that may be of use.