How to pull a normally floating pin to ground for 500ms when circuit powered on and circuit powered off
Without showing your circuit, it is hard to assess it. However, if precision is not so critical, you could use a circuit similar to the following to achieve a delay at power on and at power off. The supply voltage and time constant would have to be adapted to your case.

How it works.


Upon switch on of the power supply, the floating node is pulled to ground through M2, R2 and D4. 
The R_up and C_up network begin to charge and so does the buffer capacitor C_buffer
Once the RC(up) timer voltage is high enough, M1 is turned on, and the float node is no longer grounded.
Once the supply voltage is interrupted, the C_up capacitor is quickly discharged through R_disch
The C_buffer and R_down + R2 hold then the float node to ground for a time constant defined by their values.


For simulatin purposes, the float node assumes that it is floating if it is pulled to 10V. Since you did not provide details about you voltage levels, I considered a working voltage of 10V.