yes this is possible , u can script ur roles out as ALTER Option and then run it in batch xmla command (which contains all alter commands)
Example:-
<Batch xmlns="http://schemas.microsoft.com/analysisservices/2003/engine">
<Alter ObjectExpansion="ExpandFull" xmlns="http://schemas.microsoft.com/analysisservices/2003/engine">
<Object>
<RoleID>Role 2</RoleID>
<DatabaseID>CUBEDBID</DatabaseID>
</Object>
<ObjectDefinition>
<Role xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ddl2="http://schemas.microsoft.com/analysisservices/2003/engine/2" xmlns:ddl2_2="http://schemas.microsoft.com/analysisservices/2003/engine/2/2" xmlns:ddl100_100="http://schemas.microsoft.com/analysisservices/2008/engine/100/100" xmlns:ddl200="http://schemas.microsoft.com/analysisservices/2010/engine/200" xmlns:ddl200_200="http://schemas.microsoft.com/analysisservices/2010/engine/200/200" xmlns:ddl300="http://schemas.microsoft.com/analysisservices/2011/engine/300" xmlns:ddl300_300="http://schemas.microsoft.com/analysisservices/2011/engine/300/300" xmlns:ddl400="http://schemas.microsoft.com/analysisservices/2012/engine/400" xmlns:ddl400_400="http://schemas.microsoft.com/analysisservices/2012/engine/400/400">
<ID>Role 2</ID>
<Name>ROLE_DIV_MKT_OPRN</Name>
<Description>Access to everything</Description>
<Members>
<Member>
<Name>AMR\AD_SMS_DIV_MKT_OPRN</Name>
</Member>
</Members>
</Role>
</ObjectDefinition>
</Alter>
</Batch>