Hi
I have this functionality operating within my Arduino Home Automation system at www.2wg.co.nz. I implemented the garage door functionality early in the project - it has been fully operational for some months.
I use an Arduino controlled relay to open and close the door by bridging the door controller open/close circuit for 0.2 seconds.
I also use two reed switches - one to detect the door is fully closed and one to detect if the door is fully open. You can see real time values for my garage door at http://www.2wg.co.nz/36994/
When the closed switch changes I know that the door has just been opened and I can start various timers.
The garage door functionality operates in an active or inactive mode. In the active mode it will close the garage door if it is left open for four minutes. In inactive mode if the garage door is left open it will send a push email to my iphone after four minutes then after 8, 16, 32, 64, 128 minutes etc. That way if I am working on my car out in front of the house for a couple of hours my iPhone does not get dozens of emails.
I have implemented timer functionality using time calculations against the millis() function to avoid use of delay() (that stops an application) and can show you how to do that if necessary.
I also have a buzzer on my garage door that the arduino beeps when the door is opening and closing and for fifteen seconds before the automatic door close happens. It gives me time to move the car or myself if I am about to get hit by the door closing.
Also, if my system is in house alarm activation mode (I have PIRs to detect intruders) and the garage door is opened (e.g. with the wall switch) then my system sends an instant intruder push email to my iPhone.
Before I implemented the full functionality I did depart my house a couple of times leaving the garage door open. Since the functionality has been completed I have left it open once and on arriving at work noted the incoming push email - so I closed the garage remotely using system web site functionality only available after my password based login.
Happy to post a bit of code if you need it.
Cheers
Catweazle NZ