Can I write for another grant while being funded by a grant? If my university position is entirely funded by grant funds can I write for another grant while being funded by another grant?

More specifically the individual is a project coordinator hired by grant funds to manage a grant, not a faculty member or student.  Can this person spend time writing another grant when the project coordinators entire position is grant funded , no appropriated funds used. A PI on  the grant has asked the individual to start working on another grant during the regular hours, not outside the designated 40 hour work week. Thus, the real ethical issue can a faculty PI of a grant request a project coordinator to work on another grant
Yes and no. While most (possibly all) funding agencies will not allow you to work more than 100% of your time on a single grant, most universities will allow you to allocate more than 100% of your time (e.g., up to 125% or so) which is reasonable given a full time job is nominally a 40 hour week and 50 hours is not unheard of. This means that you are not using your time that is funded by the grant to apply for another grant, but rather some of that "extra" time. The key thing is that you need to make sure you still accomplish what you set out to do in the grant that is currently funding the majority of your time.