We took a cab from Albrook Mall to Miraflores Lock and it cost $5. It was a Tuesday morning. Admission was $8, including a visit to the musemum and observation deck. If you want to go for a buffet, I think it is $30 including admission. While we were there, there was actually a good size ship passing the lock. It was interesting to see the water raise and drop.
Mind you, you don't see ship pass every minute. Kind of depends on your luck.