Maybe I'll pick up on it better with a repeat viewing, but somebody explain to me exactly who/what the Vision was? Was it Jarvis? The Mind Gem AI? Some fusion of both?
Or was Ultron the Mind Gem AI?
I'm not 100% sure myself.
My tentative view however is that Ultron was something that came from the gem. Not sure how this all works exactly, but there was a line (from Thor?) in the scene after The Vision emerged that basically said that the twins' powers, all of their horrific visions and Ultron all came from the stone.
It's possible that when Wanda got into Stark's mind and he took the sceptre she closed some kind of circuit (having herself been given powers by the sceptre) imprinting a twisted version of Stark's psyche, hence the wise cracking.
Remember that the integration tests all failed...until Stark and Banner stepped out of the room. Even Jarvis didn't understand how it suddenly started working, which to me suggests an intelligent hand at work. Thanos perhaps? He did have it before giving it to Loki and it would certainly make the post credits scene make a little more sense if he was exerting some limited measure of influence through the gem.
I'm not saying Ultron was a fully formed mind that was trapped in the gem or some puppet of Thanos, but a twisted impression of a mind with no memory and only the Ultron program's protocols to base it's identity on (a dream, tangle in strings.)
As for the Vision, his mind was physical synthetic brain with an imprint of with Ultron's cerebral matrix, but it was interrupted less than half-way though and later had Jarvis's protocols integrated. The jump-start from Mjolnir may have also contributed as that thing apparently has some measure on a mind of it's own.