Metaphysics has come to mean what can be known about the first principles of things through introspection, in the way mathematical idealists consider mathematics to be. Ontology, the nature of being, coming to be, and change, has always been a central metaphysical topic.
Dreams have been a topic for philosophy since Zuangzhi in the 4th C. BC, who wondered if there is a meaningful distinction between dreaming he was a butterfly, or a butterfly dreaming of being a man. And Buddha characterised life on the wheel of becoming as dream-like, and understanding the true nature of things as waking up; his first statement about what he was and had attained under the boddhi tree was to say 'I am awake'. Descartes used dreaming as part of his scepticism, to try to determine what can be known even if we are currently dreaming. Robert Nozick's Experience Machine is a modern iteration of understanding what difference we make between the 'personal' reality without consequences for others of a dream-like state, and taking part in a collective experience we call 'real'.
The simulation hypothesis casts an interesting light on the distinction between metaphysics and ontology in this context
"David Chalmers has argued that we should consider the 'simulation hypothesis' not as a skeptical hypothesis that threatens our having knowledge of the external world but as a metaphysical hypothesis regarding what our world is actually made of." - from: http://philosophycommons.typepad.com/flickers_of_freedom/2014/08/the-case-for-libertarian-compatibilism-a-brief-overview.html
Buddhist thought take's this approach too, framing desiring things as part of dream-like consciousness, that our conventional selves and world are 'made of' dreams, and waking experience is on a spectrum with them. So these are ontological, and as the simulation hypothesis shows, it can potential be in a non-metaphysical context. The Yogacara 'mind only' school of Buddhism arguably goes on to a metaphysical stance, of a kind of pantheism, and the doctrine of the dharmakaya is arguably a kind of panentheism. Descartes uses the 'realness' of dreams to gonthe other way, to make universal metaphysical claims.
In a post-science world, where information, minds & thoughts have intrinsic physical consequences, metaphysics has become and increasingly unpopular category, linked to not taking evidence from the world seriously. Tegmark among others still advocate a kind of mathematical idealism, that the world is 'made of' mathematics in some way, so there are mainstream modern advocates of this kind of thing. Lucid dreamers can help determine if they are in a dream by looking at digital clocks, or flicking lightswitches, we might also expect they could by attempting to do mathematics.
Is there a useful distinction to be made? It's probably more that metaphysics is an unfashionable term, and ontology points to a narrower focus. Spongebob & Patrick meet the sage in the dream, who accompanies them afterwards, which they don't reflect on at all, so we could say they aren't really doing either. We distinguish between other minds & philosophical zombies, by applying our own impromptu Turing Tests all the time, and they encounter this other mind which passes, as well as sharing consistent memories afterwards - so it was more of a vision; and the shared memories suggest either rapid cognitive bias to agree narratives after waking up, or shared triggers like pre-hypnotic suggestions or parallel stimuli.
Dreaming is a topic we have discussed often, if you are interested in it:
https://philosophy.stackexchange.com/a/49945/30474
Have any thinkers applied empiricism to the dreaming and deep sleep states?
Infinite Sleep vs Death