Read zdas04's response twice...he's exactly right. So are most of the other answers.
Intellectual property can be tricky for an employee. You have to have an agreement with your employer if you expect anything more than an "Attaboy" for writing programs. Keep in mind they pay you to contribute to the company....in whatever fashion THEY deem appropriate. If your attitude is such that you don't want to contribute in any arena other than your assigned tasks, then don't. You'll always be "simply a staff engineer". If you show initiative and create something useful for the company, you might find that it will elevate you from being "simply a staff engineer"....but to do that, you need to check your attitude.
When I was "simply a staff engineer", your question would have never occurred to me...and yes, I've written my share of generally useless engineering code for my benefit and a few others who were inclined to use it.....on my own time usually, with no visions of it being the next panacea to engineering. I didn't break out of being "simply a staff engineer" from my programming prowess. I did it with a positive attitude that I could make a contribution and a difference in the company. I did it for them first, then I did it for me. It has worked in both.