I was seeing the same problems mentioned above and filed a bug with SE. I was told to update to XQuartz and the problem hasn't happened as often but it still occurs. What I found was that the list clibpoards (edit menu->list clipboards) was showing the proper line type and would actually paste the clipboard properly (open list clipboards, select the clipboard to paste) but the paste command (either directly calling from the command line or from a keystroke) would not paste properly. e.g. it pastes as if in char mode. I ran the debugger and you can see my analysis below of what is different.
I used the Slick-C debugger and tracked down the following:
In smartp.e, routine smart_paste2(), line 120
The call to _isclipboard_internal(1,isClipboard) returns 0 when I paste by calling 'paste'. This causes the routine paste2() on line 128 to be called and the code is pasted improperly.
When I paste using the clipboard itself (menu edit, list clipboards, choose and select the item) then the call to _isclipboard_internal(1,isClipboard) returns 1 and the ext_smartpaste() routine on line 134 is called and the code is pasted correctly.
The difference in the call to _isclipboard_internal() happens to be the call to _clipboard_format().
When I call paste(), _clipboard_format() returns ''
When I use the clipboard list, _clipboard_format() returns "pid=xxxx line"