Make sure you are embalmed, that'll stop any of that scratching in your coffin for a week business. Or specify that you don't want your funeral for a few weeks until after you have died.
The chances of it happening now are very remote - but in days gone by all sorts of gadgets were fitted to coffins - some had bells in them so the occupant could attract attention if necessary.
Quite likely here I reckon as they bury the dead in 24hrs and cement them in a wall. Terrifies me. Hopefully we'll have cremation in a few years. That's where "the graveyard shift" comes from and saved by the bell. Someone used to sit by the graves and if the bell rang they'd rescue them from the grave.
The wikipedia article linked to above contains a debunking of that myth -- "Dead Ringers" for example were good horses swapped for bad ones if they looked the same; "Saved by the bell" is a boxing expression, and "graveyard shift" originated in the US Navy.