You can publish the code itself somewhere like zenodo or figshare (disclaimer, I work for Digital Science) and have it citable like that. No need to publish a paper on it. This is how I've published code before.
Yup. For instance, nyan-mode for Emacs has had a DOI for years now: http://doi.org/10.5281/zenodo.164185.
(No reason for doing it, I was just curious if I could.)
That’s a pretty interesting idea. Can you give me some thoughts as to where it’s such a paper should be published?
The Journal of Open Source Software https://joss.theoj.org is a nice example of this.
Software should be citable. You can make it so by publishing a paper describing the software. Usually the authors then request anybody who uses the software in their research to cite that paper.