Mavericks screen lock occurs immediately instead of after 15 minutes of sleep
I have tried to replicate and analyze your problem.

The key word here is close the lid and "immediately" open it again.

There is a file called com.apple.screensaver.plist located in your user library preferences folder that should change when you change the settings for password timer. 

While observing it there is actually a slight delay in writing that file, since a temporary version is written first. If you do the immediate stuff it is possible the .plist file is not correctly completed so your 15 min delay is not working.

In your case I would take a wild ques that plist file does not change the settings to 15 minutes and it is stuck to the "Immediately" request password.

That can also be caused the corrupt ACL permissions, or the immediately action you are doing.

Make sure the plist file has the accurate date/Time stamp before attempting to close the lid.

To test log in as another user and try again. If it works with other user reset your ACL.