If I get it right, you have two non-compatible systems to interface through a PIC based circuit without any experience and without any feedback from the gate door...

I think you have to start with the classic LED flasher example and then write something more complicated and IF is not working then come here to show what you have done. Then we can offer all the help to you.

But the case here is not so easy as you think. You can't be sure when the door is open or close. So you can not give the appropriate command. There are solutions ready made for this kind of gates with the security it needs. I do this for living and for sure is not for novice!

Ioannis