Is it possible to show a view's page in the admin overlay?
It may be a bit late and unfortunately I can not assist with your php script but you can try the Overlay Paths module which can achieve something similar to what you are trying to do.

It kind of did what I needed and I say kind of because it does not work that well with Views.