Because of the shared environment we have on WordPress.com, there are code restrictions in place to protect us from potentially bad code. You can read about that here: http://en.support.wordpress.com/code/
Can you point us to a place where the code appears or can you paste it here between backticks? (You can usually find them to the left of the number 1 on the English keyboard.) That way we can see if it’s possible to use it or convert it to something else that will work on WordPress.com.