Co-directors Jonathan Dayton and Valerie Faris follow-up their beautifully balanced 2006 crowd pleaser Little Miss Sunshine with a playful Woody Allen-esque rom-com, tightly framed around a neurotic upper class writer who struggles, in equal measure, to deal with girlfriend and his imagination. The Kaufman-like twist in Ruby Sparks is that they are in a sense one and the same.

Like Paul Giamiatti’s character in Sideways (2004) and Jeff Daniels’ in The Squid and the Whale (2005), Calvin (Paul Dano) is a talented writer struggling to shirk the weight of expectation heaped upon him. He’s young, a sort of JD Salinger type, regularly reminded of his brilliance despite having only written one novel. The juices aren’t flowing and his love life is dead in the water, until they unexpectedly come together.

For a new novel, Calvin creates a free-spirited character called Ruby (Zoe Kazan) and returns home one day to find her sitting on his couch.

Ruby is as real as he is but still obeys the strokes of his typewriter. If Calvin writes, for example, that Ruby is feeling sad, she mopes around the house crying; if he writes that she is infatuated with him, she won’t leave him alone, etcetera. There’s a great, borderline sadistic scene in which Colvin proves his powers as a puppet master.

A sharp toothsome screenplay from Zoe Kazan, who also stars as Ruby and plays her with honey-eyed cordiality, takes what could have been a simple gimmick and makes it a source of conundrums for Calvin, a way of stretching and exploring his character as he creates and tinkers with Ruby’s. Dayton, Faris and Karzan unfold the story with a playful mixture of knowing absurdity, sweet nothings and fantasy-tinted prosaic drama.

Ruby Sparks was partly inspired by Henry Koster’s 1950 masterstroke Harvey, which is mentioned in dialogue. A creation of someone’s imagination exists — in the case of Harvey, a giant rabbit — but other people inside the film’s reality can see it, proving it ‘true’ and broadening the surrounding playground into a semi-metaphysical context. In Ruby Sparks, like in Kaufmann scripts, the insertion of fiction into reality is a part of the film, as is the insertion itself.

If this sounds at all complicated, the film is executed with unprepossessing affection for its characters and the environments they inhabit, which isn’t to say it sugar coats the pill (Colvin is an obviously flawed individual). Ruby Sparks isn’t a circuit-breaker or a must-see; it’s quietly courageousness, if you like, in its efforts to find a different track to tinker with a familiar premise about an author’s incapacity to write.

Its crowning achievement is the creation of a sort of reversal of writer’s block fiction: the invention of a gap in the protagonist’s mind that cannot not create, producing quirky narrative bits and bobs that — like the film — have no profound bearing but provide a pleasant reprieve.

Ruby Sparks is playing at The Melbourne International Film Festival and will be released nationally September 20, 2012.