Properties are pointers, to put it simply. If you have a particular reference that you need to manipulate, you make an ObjectReference property (in this case we'll call it myDoor) and then you have to set the property (by double clicking the script, and then clicking the property you want to set, and then either selecting it in the render window or by selecting the cell and then the particular reference in the drop down boxes). Now you have a property that is properly 'pointing' out which reference your script is talking about.
So, your script would look like this:
Scriptname OpenDoorWithParticularSpell extends ObjectReference;always declare properties outside of events or functionsObjectReference Property myDoor autoSpell Property mySpell autoEvent OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, \ bool abBashAttack, bool abHitBlocked); it is very important that you include all of the parameters of an event, or it simply won't work the easiest way to do this is to ccopypaste the function or event from creationkit.comif akSource==mySpell SetOpen()endIfendEvent
EDIT: Oh, I assumed you were placing this on the door itself. If you wanted to hit, say, a target and have that open the door you would just replace SetOpen() with myDoor.SetOpen(). The ObjectReference property isn't necessary if you're placing the script on the object being opened though.