1. Create the marker in the mission editor and make it type "empty" and name it marker1. Use the addAction command to add the action to the player. When the action is used,
marker1 setPos getPos player
marker1 setMarkerType "whatever marker type you want"
2. Learn about eventHandlers, particualarly "killed". The action can then be added on death.
3. you need the onMapSingleClick command. This is slightly tricky and I recommend you get 1. and 2. nailed down before tackling this. Search the forums, much good advice has been given in the past.
Syntax etc not guaranteed at all, this is just a sketch.