Yup. about the same plan I have! I would dig the ditch, line the hole with landscape fabric BEFORE putting in the pea gravel. Encapsulate the gravel + pipe and you will never be clogged up. The pea gravel will also allow holding a greater volume of water.

One thing I worry about is safety, leaving the lid too large and someone squeezing in there and not getting back out. Would make for some pretty yucky water for a while. ;-). Probably keep a ladder in there if the vertical pipe was 10" or more.