You can definitely buy a LIRR/Metrocard combo from the machines at Penn Station. But like Analise I'm not sure if there are LIRR machines on the Airtrain side of the turnstiles at Jamaica, because I always just take the subway. My guess is that you'll find LIRR machines there if you look tomorrow.
Have fun.