Danger in 3D printing over a lithium ion battery
I would have to see your design to comment more but why not just change your model with the lid or top that can be either fused on later or attached in some other fashion? 

It is possible to turn off the heated bed after a certain layer. It looks like there is a discussion here with the G-code: Can Cura Turn Off a Heated Bed Partway Into a Print?

I would personally avoid exposing the battery to the heat generated by the hotend or the build plate. Printers alone can burn your house down. Why combine it with the awesome power of a lithium ion battery?