Get Boston's book, You and the Police. avalible at
www.javelinpress.com Very informative, and will teach you how to handle such situations. I consider it a must read, expecially in those places that may have "problematic" police (ie, Chicago, NYC, NJ, PRK)
The police were within their rights to ask for I.D. due to the park being closed. They could have issued a citation. Having the CCW permit in sight with wallet open is sloppy, but a Terry search could have been initiated just by being in the park after hours, not due to the permit. That is what the police will say. The car would have been subject to a Terry search if you were in it, due to immediate proximity, but anything locked (glove box, trunk) could not have been. If an invasive search (ie, inside pockets, trunk, glove box, locked vehicle if you were NOT in it) was wanted, the police would of HAD to articulate REASONABLE SUSPICION on scene to innitiate a search with out a warant.
From what I read, the police seemed to be within their rights.
Usually when I found myself in a bad situation with the police, I could latter reflect on just what one little thing caused my problem. Like being 15 minutes past closing in a "piblic" park.
Get the book, read it and reflect. I helped me to be under the radar in any involvement with law enforcement. I keep my F.O.I.D. (required in ILLINOIS

)card burried deep, so it won't show durring a traffic stop. It keeps them one step further away from my firearms if they don't have any identifiable reason to think I have any with me. Helps alot if you happen to get an anti-gun officer.