How do astronomers detect the 'metals' in a star? If the atoms are presumably completely ionized?
You are correct that the characteristic emission and absorption lines we see in stars' spectra are from electrons that are bound to atoms making transitions between different energy levels.  That is possible because the elements in a star's photosphere are not fully ionized.  Hydrogen - the easiest element to fully ionize because its nucleus only has a charge of +1 - is pretty highly ionized in the hottest stars (O stars), which is why those stars have weak hydrogen lines in their spectra.
Completely ionized atoms (bare nuclei) do not absorb or emit electromagnetic radiation in the parts of the spectrum where stars emit most of their light.  They can absorb very high energy photons (gamma rays with energies of millions of electron volts) that have enough energy to excite their nuclear energy levels, but the photospheres of stars aren't hot enough to emit this kind of radiation (and as previously stated, the atoms there aren't fully ionized anyway).
Many stars have elements in their photospheres that are partially ionized, but the spectral lines we see from those atoms are still from the remaining bound electrons.  For example, Ca II (singly-ionized calcium, with 19 electrons instead of 20) has strong lines in the violet part of the spectrum of the Sun.