Except that you are no longer heavily obscured and can be seen. Sticking your head out is going to reveal you.there's no reason to think that you can't peep out and whip a dagger at someone. If they've failed their perception check vs your hide, that's sufficient reason to believe they've lost track of you. The attack's going to reveal you, but by then it's too late - the dagger (or arrow, bolt, whatever) is on its way.
I could see doing it in some specific circumstances if you purposely "peep out" somwhere which is outside the enemies field of vision but the conditions would have to be right.