this is a fairly simple bit of code, but only when you know how!
you need to have the brush type of the 'ghost' set as dynamic, with the collider property set to 'call handler' so that it calls the handler when dizzy collides with it, and also set the Death property to a number (for example 1). this enables you to identify the ghost in the handler, and also enables you to have custom text should the 'ghost' hurt and kill you. You also need to have the Class property set to either hurt or kill. (oh and don't forget to give the 'ghost' an ID number.)
then you need to modify part of the HandlerCollision() function in the handlers.gs script file, to read something like the following code. i'll assume the powerpill is object ID 1000.
compare the bit of code above with the HandlerCollision() function in the default handler. if the item has a class of 'hurt', what the extra bit of code does is firstly identify if the object collided with has a Death property of 1. if it does, then it then looks if the powerpill (ID 1000) is in the inventory. if it is, it disables the item you've collided with (the ghost), beeps, and stops the handler from going any further (using return; ). if either of those isn't true, it will bypass the extra code and harm the player.
if(ObjGet(idx,O_CLASS)==CLASS_HURT && mode!=0) // hurt objects
if(ObjGet(idx,O_DEATH)==1) // death cause is ghost
if(InventoryFind(ObjFind(1000))!=-1) // powerpill is in the inventory
return; // don't hurt