If you just want to pick up only slices of pumpkin pie there are several ways to change the code. Fastest way is to change in the "CustomCanPickUp()" method. Change all returns to false, except the variable for the eventitems (i think it was the elseif with the CheckArrayPscon-method). Second change you need, change the line in the beginning where you define which pcons you want to pickup, e.g. to
Global $Array_pscon[1]=[28436]
28436 is the modelID for the slice of pumpkin pie
Edit:
Faster would of course be:
Add another elseIf in the CanPickUp method, check modelID for 28436 and return true, every other to false.