I've seen that we should use the Perfect to say about prior events that happened at a certain time and that give us context. Now, in this sentence here:
A: Hello, Allie.
B: I don't wanna talk to you. I have geometry class now, so, can you leave?
A: Wait! I wanna know if you were the one who wrote this and put it into my locker!
B: No, it wasn't me! [...]
Instead of using Simple Past, could I use Past Perfect?
A: [...] Were you the one who had written this and put it into my locker!
And If I can, what are the differences between using the former and the latter?
I believe that:
•The former - Establishes more like an event, the focus is to narrate a past event; •The latter - Establishes a context, the focus is to say about an existencial past (that is, a past that happened).