@tanguatlay,
No- the second part of the sentence is confusing- although I think that people can ascertain the meaning the way it's written, I would rewrite it thus:
When the ballerina programme ended, Jane put on some music and began to imagine herself a ballerina, dancing as it she and the music were one.
or you could make your meaning even clearer by saying:
When the ballerina programme ended, Jane put on some music and imagining herself a ballerina, danced as if she felt as one with the music.
There are all sorts of ways to express it- you just have to choose the one that sounds the best to your own ear - especially with a subject such as this - flow is important.